[DB-SIG] over the API

Federico Di Gregorio fog@mixadlive.com
26 May 2001 01:14:51 +0200


    you are quite right. i begun to write a new pep, on dbapi extensions
(see past thread on this mailing list.) my idea is to both document
"standard" extensions to the dbapi and provide a reference
implementation (where possible) in python. apart from the stuff you
simply can't do without some help from the driver, like type-casting.
(type casting should be done by the driver, because the next layer won't
have any clues on the original types, for example.)

    i hope to have something to post in a week or two but my work the
new release of psycopg (finally implementing the *full* api) is keeping
me busy.

On 25 May 2001 13:08:30 +0200, pierre@saiph.com wrote:
>     I have the feeling, and many people seem to have the same, I lack
>     some obvious functionnality when using the DB-api; I have seen
>     many demands to add functionnality on this list, and a good answer
>     to this: lets not increase the burden of the implementers: if its
>     too high, people will become reluctant to comply to the API;
>        - Automatic building of queries, from a {col: 'value'} dict.

this is in the dbapi. if the driver support the pydict style you can
simply do:

    cursor.execute("INSERT INTO baz VALUES (%(foo)s, '%(bar)')", 
                   {'foo':23, 'bar':'i love psogresql'}) 


Federico Di Gregorio
MIXAD LIVE Chief of Research & Technology              fog@mixadlive.com
Debian GNU/Linux Developer & Italian Press Contact        fog@debian.org
                             Best friends are often failed lovers. -- Me