I'm working with SQLite databases located on NFS mount which is
proving to be too slow. However, since the access is mostly read-only,
when local disk space allows for that, I can make a copy of the
database in the temp space and work with it instead.
I'd like to do it as nonintrusive as possible, yet fairly explicit. My
question is what part of SQLA framework makes most sense to extend/sub-
class for that purpose? I'm having hard time deciding what object
should be responsible for the lifetime of that cache. My best guess
is, conceptually, Session is the closest one, however I'm also
considering Engine objects.
My plan was that when an engine gets bound to session, I perform the
database copy and create another engine which actually binds. When the
session expires, temporary database is collected. But at this point,
trying to make a simple Session subclass like so:
from sqlalchemy.orm.session import Session
from sqlalchemy.orm import sessionmaker
def CachedSession(Session):
pass
MySession = sessionmaker(class_=CachedSession)
results in metaclass conflict, so I'm not sure how to proceed here.
Does the whole thing even make sense and maybe there's a better way to
do this? My constraint is that I need to stick to SQLite for various
other reason, which is not directly related to the discussion.
Thanks,
Dimitri.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"sqlalchemy" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/sqlalchemy?hl=en
-~----------~----~----~----~------~----~------~--~---