Re: [RFC] ideas for a new Python DBAPI driver (was Re: libpq test suite) - Mailing list pgsql-hackers

From P. Christeas
Subject Re: [RFC] ideas for a new Python DBAPI driver (was Re: libpq test suite)
Date
Msg-id 201302180055.35145.xrg@linux.gr
Whole thread Raw
In response to [RFC] ideas for a new Python DBAPI driver (was Re: libpq test suite)  (Manlio Perillo <manlio.perillo@gmail.com>)
List pgsql-hackers
On Thursday 14 February 2013, Manlio Perillo wrote:
> Il 14/02/2013 14:06, Albe Laurenz ha scritto:
> > Manlio Perillo wrote:
> >> Sorry for the question, but where can I find the libpq test suite?
> >> I can not find it in the PostgreSQL sources; it seems that there are
> >> only some examples, in src/test/examples.
> > 
> For my Python DBAPI2 PostgreSQL driver I plan the following optimizations:
> 
> 1) always use PQsendQueryParams functions.
> 
>    This will avoid having to escape parameters, as it is done in
>    psycopg2
>    (IMHO it still use simple query protocol for compatibility purpose)
> 
> 2) when the driver detects a Python string is being sent to the
>    database, use binary format.
> 
>    As a special case, this will avoid having to use PQescapeByteaConn
>    when sending binary string (e.g. byte strings in Python 3.x)
> ....

Perhaps you could also see some attempt I'd made to support binary protocol 
inside psycopg2, some time ago:

https://github.com/xrg/psycopg/tree/execparams2



-- 
Say NO to spam and viruses. Stop using Microsoft Windows!



pgsql-hackers by date:

Previous
From: Andrew Dunstan
Date:
Subject: Re: JSON Function Bike Shedding
Next
From: Tomas Vondra
Date:
Subject: Re: PATCH: Split stats file per database WAS: autovacuum stress-testing our system