[PYTHON DB-SIG] Re: Informix module
Greg Stein
greg_stein@eshop.com
Thu, 25 Jan 1996 14:24:43 -0800
> def exec(self, operation, params=None):
> def execagain(self, params=None):
>
>I don't like this system...I would prefer
>
>def prepare(self, operation, params=None):
>def exec(self):
>
>Obviously, your way would work, but it would complicate the most
>common idiom -- construct a server (do the prepare()) then while you
>are running, process each transaction (do the exec()).
We talked about this. I believe we agreed to:
- toss execagain(). just have exec().
- remember a reference to the operation object (a string object).
- if exec() is called with the same string object, then it will skip the
parse step
- all parameters will attempt to reuse bind areas, realloc'ing as needed
when bind area sizes change
> def fetchone(self):
>
>You could call this just "fetch()"
We agreed to keep the name, right? I believe fetchone() is clearer,
particularly given that two other fetch methods exist.
>Could this be implemented in a database with no built-in notion of
>cursor?
I hope so. The cursor() method is defined to throw an exception if cursors
are not available (actually, the straw man didn't specify this, but I meant
it to :-). I sort of left the discussion of exceptions empty, instead
preferring to wait for feedback on the API from a higher level. The
connection object is defined to act as a cursor. For simple usage, people
generally won't even attempt to use a cursor, relying on the connection
object instead.
Vincent also made one suggestion: that the params can be specified as a
list/tuple of tuples. This would only be allowed for INSERT statements and
would imply array-insert operations (based on the cursor's arraysize).
Lastly, I think we should probably change Cursor.arraysize() to an
attribute that can be get/set. And we can change Cursor.describe() to a
read-only attribute named description. Note that we can't really change the
setcolsize() method because I spec'd it to be able to set individual column
sizes (or default when col=None). The column is specified as a 0-based
integer or by (case-sensitive) name.
Greg Stein, eShop Inc.
greg_stein@eshop.com
=================
DB-SIG - SIG on Tabular Databases in Python
send messages to: db-sig@python.org
administrivia to: db-sig-request@python.org
=================