Ligare.database.engine.postgresql

Integrations with SQLAlchemy’s PostgreSQL engine.

Classes

PostgreSQLScopedSession(session_factory[, ...])

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 Session instances. This is usually, but not necessarily, an instance of sessionmaker.

  • scopefunc – optional function which defines the current scope. If not passed, the scoped_session object assumes “thread-local” scope, and will use a Python threading.local() in order to maintain the current Session. 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 current Session.

static create(connection_string, echo=False, execution_options=None, connect_args=None, bases=None)[source]
Return type:

PostgreSQLScopedSession