executemany ('SELECT ...') (was: [DB-SIG] DBAPI-2.0 clarifications)

Federico Di Gregorio fog@mixadlive.com
Wed, 21 Mar 2001 14:45:06 +0100

Scavenging the mail folder uncovered M.-A. Lemburg's letter:
> Here's a list:
> - transaction behaviour (implicit start of transactions when creating
>   a cursor, implicit rollback when cursor is closed)

er... em... no. in a previous mail you said that cursors
are not transaction-aware. this is very similar to the per-cursor
commit extension implemented (and outruled by the dbapi) by
psycopg, popy and maybe other drivers.

> - handling of multiple result returns using .nextset()
> - handling of SELECT with .executemany()

ok, we are discussin it.

> - how to treat special database data types such as decimals
>   and file column bindings

i have some ideas on how to implement type-casting from db types
to python types and classes. psycopg impelemnts two module functions
(new_type() and register_type()) that can be used to register a new
singleton type object (just like STRING, NUMBER, etc...) and let
the driver use it to typecast from the db. the default types (STRING,
etc...) are just created using those functiuons at module loading
time. if you are interested i can write some lines about that or you 
can donload psycopg sources and look for the types_test.py script.