Ligare.database.engine.sqlite

Integrations with SQLAlchemy’s SQLite engine.

Classes

SQLiteScopedSession(session_factory[, scopefunc])

class Ligare.database.engine.sqlite.SQLiteScopedSession(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]

Create a new session factory for SQLite.

Return type:

SQLiteScopedSession