get_flask_sqlalchemy_lite_proxy_ver
FunctionSource
(
db: SQLAlchemyLiteProxy[flask_sqlalchemy.SQLAlchemy],
model_class: type[_ModelLite],
) = get_flask_sqlalchemy_lite_proxy_ver[_ModelLite](
model_class: type[_ModelLite],
app: Flask | None = None,
engine_options: Mapping[str, Any] | None = None,
session_options: Mapping[str, Any] | None = None,
)
Proxy version of get_flask_sqlalchemy_lite
.
The usage and the returned value of this function is totally the same as
get_flask_sqlalchemy_lite
. However, the first returned value will be
deliberately notated by
SQLAlchemyLiteProxy
,
which can be used by the coders
who want to use this type to remind remind them the compatibility supported
by the falling back version.
Aliases
This function can be acquired by
import flask_sqlalchemy_compat as fsc
fsc.get_flask_sqlalchemy_lite_proxy_ver
fsc.auto.get_flask_sqlalchemy_lite_proxy_ver
Arguments
Requires
Argument | Type | Required | |
---|---|---|---|
model_class | type[_ModelLite] | The base model type applied to the whole database. If flask_sqlalchemy_lite is available, this type will be directly forwarded as it is. It will not modify anything. However, if the db instance fallback to the version provided by flask_sqlalchemy , this type will be used for creating the db-specific model type. | |
app | Flask | None | Call init_app on this Flask application. If not specified, will not call init_app . | |
engine_options | Mapping[str, Any] | None | Default arguments passed to sqlalchemy.create_engine for each configured engine. | |
session_options | Mapping[str, Any] | None | Arguments to configure sessionmaker with. |
- where
_ModelLite
is aTypeVar
ofsa.orm.DeclarativeBase
.
Returns
Argument | Type | |
---|---|---|
db | SQLAlchemyLiteProxy[flask_sqlalchemy.SQLAlchemy] | The SQLAlchemy Lite extension instance. In run time, it is the same as the returned value of However, this returned value is always notated by |
model_class | type[_ModelLite] | If If |