Re: A list of open points in the documentation
Federico Di Gregorio <fog-NGVKUo/i/[email protected]>
| Newsgroups | gmane.comp.python.db.psycopg.devel |
|---|---|
| Message-ID | <[email protected]> |
On 10/02/2010 05:38, Daniele Varrazzo wrote: > Hello, > > the psycopg documentation is almost finished. It can be previewed on > http://piro.develer.com/psycopg2-doc/ > > While working at it, a lot of points came up: i recorded them in the > todo list and now it's time for a few answers. Please help me to > clarify these points. > > 1. the DBAPI says about cursor.execute(): > """ > A reference to the operation will be retained by the cursor. If the > same operation object is passed in again, then the cursor can optimize > its behavior. > """ > does psycopg do this? No. This is part of preparing queries and is not currently implemented. > 2. does cursor.arraysize influence cursor.fetchall? No. > 3. DBAPI says that scroll() should raise IndexError. Psycopg raises > ProgrammingError instead. I'd say this is a bug, but maybe it's too > late to be fixed. Shall we keep it this way? Shall I point out the > discrepancy between dbapi and psycopg in the docs or keep it quiet? This is surely a bug but I fear to break a lot of stuff out there fixing it. We should probably add a "strict dbapi" flag that if enabled makes psycopg to do the right thing. Currently I'd just document the discrepancy. > 4. in order to use the tuple adapter to the IN syntax, > psycopg2.extensions has to be imported. Is this a bug (it has already > bitten me once) to be fixed or a "feature" to document? It is a feature. Almost all extensions to the DBAPI (except ones in the C code) are enabled by importing psycopg2.extensions. > 5. Does psycopg user ever have to directly use the ISQLQuote object? > in my knowledge it is just a symbol used internally for adpters > dispatch. Has he ever to instantiate it? Are the methods defined on it > any useful? It is used internally. The user may need it only if writing its own adapters but even then adapters can be written without using it because psycopg tests for the needed mathods (like getquoted()) anyway. > 6. The binary adapter is not imported in the psycopg2.extensions > module while all the other adapters seem there. Shall i add it too? I don't understand what you mean here? > 7. What does the second parameter of register_type do? It seems what i > described here: > http://piro.develer.com/psycopg2-doc/extensions.html#psycopg2.extensions.register_type > Is this confirmed? Yes. You can register adapters valid only for a single cursor or connection. > 8. Is binary_types in psycopg2.extensions and on the connection class > used? Or only string_types is? Currently only string_types is. > 9. Is any connection status constant useful, apart from READY and > BEGIN? These states don't seem matching any informative function of > the libpq. http://piro.develer.com/psycopg2-doc/extensions.html#connection-status-constants They are used internally and exported for coherency. federico -- Federico Di Gregorio fog-NGVKUo/i/[email protected] In science one tries to tell people, in such a way as to be understood by everyone, something that no one ever knew before. But in poetry, it's the exact opposite. -- Paul Dirac _______________________________________________ Psycopg mailing list Psycopg-IAPFreCvJWPBWskQ1e/[email protected] http://lists.initd.org/mailman/listinfo/psycopg
signature.asc
(application/pgp-signature, 262 B)
-----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAktyaHIACgkQvcCgrgZGjesGCACfQvU8HEVLTCwYrMBcc3chZB02 EAoAnRRl7nsZdrp2oNSTqE2GNhs94Xbq =QMku -----END PGP SIGNATURE-----