create_engine *maybe* did something like this in the 0.1 series - it
would return a new engine, but its possible that it was using the
connection pool's manage() function to return a singleton instance of
the underlying pool. such magical things were ripped out of SA since
last april.
to create this functionality on your own, just use everyone's favorite
Singleton pattern:
import sqlalchemy
_engines = {}
def create_engine(url, **kwargs):
try:
return _engines[url]
except KeyError:
return _engines.setdefault(url, sqlalchemy.create_engine(url,
**kwargs)
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---