Gino(app=None, *args, **kwargs)¶
Support Sanic web server.
init_app()GINO registers a few hooks on Sanic, so that GINO could use database configuration in Sanic
configto initialize the bound engine.
A lazy connection context is enabled by default for every request. You can change this default behavior by setting
DB_USE_CONNECTION_FOR_REQUESTconfig value to
False. By default, a database connection is borrowed on the first query, shared in the same execution context, and returned to the pool on response. If you need to release the connection early in the middle to do some long-running tasks, you can simply do this:
query_ext -- Boolean value to control the installation of the
Executablefor implicit execution. Default is to install (
schema_ext -- Boolean value to control the installation of the
SchemaItemfor implicit execution. Default is to install (
ext -- Boolean value to control the installation of the two
Falsefor no extension at all, while it depends on the two individual switches when this is set to
kwargs -- Other arguments accepted by
model_base_classes= (<class 'gino.crud.CRUDModel'>, <class 'gino.ext.sanic.SanicModelMixin'>)¶
GinoEngine(dialect, pool, loop, logging_name=None, echo=None, execution_options=None)¶