Il giorno mar, 05/09/2006 alle 17.39 -0400, Cristian Gafton ha scritto:
> - server side cursors. Currently, most bindings for most databases have to 
> decide what to do after an cursor.execute() call - do they automatically 
> retrieve all the resulting rows in the client's memory, or do they 
> retrieve it row by row, pinging the server before every retrieval to get 
> more data (hey, not everybody using Oracle ;^). DB API has no support 
> for controlling this in a consistent fashion, even though Python has 
> solved the issue of dict.items() vs dict.iteritems() a long time ago. 
> The application writers should have a choice on how the cursors will 
> behave. 

Sure. psycopg 2 uses a little extension to the dbapi and adds to
cursor() an extra parameter: "name". If a cursor is named then a server
side cursor with that name is automatically generated (and destroyed at
the end of the current transaction) else, if name is None, a normal
cursor is created. Then fetchXXX() methods do the right thing without
the need to introduce extra methods.

federico

-- 
Federico Di Gregorio                         http://people.initd.org/fog
Debian GNU/Linux Developer                                [EMAIL PROTECTED]
INIT.D Developer                                           [EMAIL PROTECTED]
                      Sei una bergogna. Vergonga. Vergogna. -- Valentina

Attachment: signature.asc
Description: Questa รจ una parte del messaggio firmata digitalmente

_______________________________________________
DB-SIG maillist  -  DB-SIG@python.org
http://mail.python.org/mailman/listinfo/db-sig

Reply via email to