[Twisted-Python] laxdb - an async dbapi wrapper
Matt Goodall
matt at pollenation.net
Wed Aug 31 08:31:11 EDT 2005
Hi,
In response to the announcement of the Twisted Asynchronous Database Api
(tada), <http://www.darkarts.co.za/projects/tada/, I thought I should
mention something I wrote.
[Unfortunately, tada does not use threads correctly so it's likely to
break. The author knows this and has added a warning to the module for now.]
A while back, I started messing around with making a standard, blocking
db-api module appear non-blocking but with a deferred API. I called it
laxdb and it's in my sandbox.
svn://svn.twistedmatrix.com/svn/Twisted/sandbox/mg/laxdb.py
http://svn.twistedmatrix.com/cvs/sandbox/mg/laxdb.py?view=markup
laxdb is quite literally an async db-api interface and not a
t.enterprise.adbapi style interface. In particular, it provides exactly
the same API (but deferred) and it doesn't take over transaction
management. It also doesn't wrongly call a cursor, "Transaction" ;-).
I recently went back to laxdb and finished it off, also adding a
connection pool implementation.
Now, I haven't used laxdb in a real project and there are no unit tests
but I think it's reasonably complete. It should work with any dbapi
module that has threadsafety level 1 or higher, just like adbapi.
If there's interest in this way of accessing a database then I would be
happy to write tests etc, move it into Twisted and maintain it.
Cheers, Matt
--
__
/ \__ Matt Goodall, Pollenation Internet Ltd
\__/ \ w: http://www.pollenation.net
__/ \__/ e: matt at pollenation.net
/ \__/ \ t: +44 (0)113 2252500
\__/ \__/
/ \ Any views expressed are my own and do not necessarily
\__/ reflect the views of my employer.
More information about the Twisted-Python
mailing list