Ligare.database.engine.postgresql
Integrations with SQLAlchemy’s PostgreSQL engine.
Classes
|
- class Ligare.database.engine.postgresql.PostgreSQLScopedSession(session_factory, scopefunc=None)[source]
- __init__(session_factory, scopefunc=None)[source]
Construct a new
scoped_session.- Parameters:
session_factory – a factory to create new
Sessioninstances. This is usually, but not necessarily, an instance ofsessionmaker.scopefunc – optional function which defines the current scope. If not passed, the
scoped_sessionobject assumes “thread-local” scope, and will use a Pythonthreading.local()in order to maintain the currentSession. If passed, the function should return a hashable token; this token will be used as the key in a dictionary in order to store and retrieve the currentSession.