On Fri, 2002-03-01 at 04:16, Dario Lopez-Kästen wrote:
> I'd like to see ZSQL methods altered so that bind variables could be used in
> SQL queries.

+1, even though MySQL doesn't bind variables (yet, apparently in the
works for 4.0).

Another thing I would like (and could probably write) is an additional
skip_rows parameter (default 0) to Z SQL Methods to complement max_rows.
Since this needs to be passed to the DA's query(), and no DA's currently
accept this parameter, one of these things need to happen:

1) Trap the TypeError that results from calling a query() that doesn't
recognize skip_rows (used as a keyword parameter). In that case, fall
back to query(q, max_rows+skip_rows) and return result[skip_rows:] in
the Z SQL Method.

2) Add a new DA method query_range(q, skip_rows, max_rows); if
AttributeError, fall back like #1.

3) Simply require all DA's to implement it in query() as a keyword
parameter to maintain backwards compatibility with older Zopes.

Adding this would make Z SQL Methods work a bit more like <dtml-in ...
start=skip_rows size=max_rows>. There may be issues with result caching,
but I don't think it'll be too much of a problem.

-- 
Andy Dustman         PGP: 0x930B8AB6
    @       .net     http://dustman.net/andy
You can have my keys when you pry them from my dead, cold neurons.


_______________________________________________
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists -
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )

Reply via email to