cliche.web.db — Database connections¶
Use session in view functions.
-
cliche.web.db.close_session(exception=None)¶ Close an established session.
-
cliche.web.db.get_database_engine()¶ Get a database engine.
Returns: a database engine Return type: sqlalchemy.engine.base.Engine
-
cliche.web.db.get_database_engine_options()¶ Get a dictionary of options for SQLAlchemy engine. These options are used by
get_database_engine()and passed tosqlalchemy.create_engine()function.
-
cliche.web.db.get_session()¶ Get a session. If there’s no yet, create one.
Returns: a session Return type: Session
-
cliche.web.db.session= <LocalProxy unbound>¶ (
LocalProxyofSession) The context local session. Use this.