[Twisted-Python] SQL Abstraction Layer

Paul G paul-lists at perforge.com
Tue Jan 17 21:34:11 EST 2006


----- Original Message ----- 
From: "Valentino Volonghi aka Dialtone" <dialtone at divmod.com>
To: "Twisted general discussion" <twisted-python at twistedmatrix.com>
Sent: Tuesday, January 17, 2006 11:47 AM
Subject: Re: [Twisted-Python] SQL Abstraction Layer


On Tue, Jan 17, 2006 at 08:58:36AM -0500, Paul G wrote:
>> what would help, i think, is some documentation/examples describing how
>> this can be achieved with specific implementations. there's no reason 
>> this
>> has to be in the official twisted documentation or written by twisted
>> folks, necessarily, it would be good for it to just exist ;) dialtone's
>> italian post shows the minimalistic example, but as he (through the
>> translation) states, it probably won't be anywhere near as simple to use
>> sqlalchemy's ORM features.

> ORM features should work without problems but you'll have to use the 
> 'eager'
> query mode everytime since retrieving stuff lazily means running queries 
> for
> attribute access and this is what you want to avoid for blocking reasons.

correct me if i'm wrong, but hacking/monkeypatching the sqlalchemy accessors 
which implement this lazy load when attributes are accessed to run their 
queries with deferToThread() would remove this problem, would it not? more 
generally speaking, if you're not going to do explicit deferToThread()s in 
your code (and avoid all attribute access), but rather, say, insert them 
into the appropriate point in sqlalchemy (sqlengine seems ro tbe the right 
place, or just a wrapper around the dbapi module), would this not handle the 
issue as well? am i asking the wrong person/on the wrong list? ;]

-p 





More information about the Twisted-Python mailing list