[Twisted-Python] Simplifying database access in Twisted

Thomas Weholt 2002 at weholt.org
Thu Jun 19 17:13:07 EDT 2003

Just read thru http://www.twistedmatrix.com/documents/howto/enterprise and
tried to fit the code to my needs, but ... this seems way too complicated.
All I want is to execute a SQL-query and do something similar to fetchone or
fetchall etc. in the DB-API 2.0 spec. I don't want to be forced to write
classes and callbacks etc. just for a simple list of tuples or something
returned from a SQL-query.

Is there no other way to do simple database access in Twisted? Something
more like the DB-API 2.0? The docs says "This is straightforward ...". No,
it's not. The example a bit further up on the same page, now that's
straightforward. Perhaps it's just me not getting all the callbacks and
whatnot, but this seems too hard, too much code for such a simple task. All
I want is a database-object to feed sql-statements, which returns the
results as dictionaries or list of tuples, as close to DB-API 2.0 as
possible. Any hint or clue would be highly appreciated.

PS! I don't mean to step on anyones toes or anything, so forgive me if I'm a
bit harsh. But this might be the bitter end of my journey into the realms of
Twisted. Quick, fast and easy access to a database will make-or-break all of
my current projects, all of which are based on Twisted.


More information about the Twisted-Python mailing list