The congress.db.api Module

congress.db.api.commit_unlock_tables(session)

Commit and unlock tables for supported backends: MySQL and PostgreSQL

congress.db.api.get_engine()

Helper method to grab engine.

congress.db.api.get_locking_session()

Obtain db_session that works with table locking

supported backends: MySQL and PostgreSQL return default session if backend not supported (eg. sqlite)

congress.db.api.get_session(autocommit=True, expire_on_commit=False, make_new=False)

Helper method to grab session.

congress.db.api.is_mysql()

Return true if and only if database backend is mysql

congress.db.api.is_postgres()

Return true if and only if database backend is postgres

congress.db.api.is_sqlite()

Return true if and only if database backend is sqlite

congress.db.api.lock_tables(session, tables)

Write-lock tables for supported backends: MySQL and PostgreSQL