[Soc2006] Pure Python SQL API

Ian Bicking ianb at colorstudy.com
Thu May 4 21:29:59 CEST 2006


Jorge Vargas wrote:
> In reply to Karol, really nice link I didnt had that. although I knew 
> about it.
> 
> In terms of http://java.sun.com/products/jdbc/driverdesc.html right now 
> python has type2 drivers.
> 
> My original idea will be a type3, although 4 seems more efficient.

Type 3 seems odd -- like some sort of transitional technique you'd use 
in an environment when it's too hard to put C code directly in the 
process (like... Java?)  I don't think it makes much sense for Python.

>      There are some
>     pure-Python db connectors out there; I've seen at least two Postgres
>     ones
> 
>     * http://barryp.org/software/bpgsql <http://barryp.org/software/bpgsql>
>     * http://www.tnr.cc/pypg.html
> 
> 
> that seems like really alpha code :)

A good sign; if there wasn't anything out there, then no one has thought 
the idea interesting enough to try.  If there was mature code out there, 
then you'd be out of a proposal.

>     There might also be some interest from people wanting to do async
>     database connections, because even if you create a blocking API (DB-API
>     is blocking) it would be far far easier to adapt or extend a pure-Python
>     driver to be async.
> 
> 
> I'm not sure how will that be usefull, you can't rely on your 
> information being on the db, even if you send it?

I don't know the details, but Twisted does have an interface for 
asynchronous database access.  I assume the queries are ordered, it's 
just that you don't block waiting for them to complete.


-- 
Ian Bicking  /  ianb at colorstudy.com  /  http://blog.ianbicking.org


More information about the Soc2006 mailing list