as_flask_sqlalchemy
FunctionSource
db: _SQLAlchemyDB = as_flask_sqlalchemy(db: _SQLAlchemyDB)
db: SQLAlchemyProxy[_SQLAlchemyLiteDB_co, _ModelLite_co] = as_flask_sqlalchemy(
db: _SQLAlchemyLiteDB_co,
model_class: Type[_ModelLite_co],
)
Make db
works as flask_sqlalchemy
.
Aliases
This function can be acquired by
import flask_sqlalchemy_compat as fsc
fsc.as_flask_sqlalchemy
fsc.flask_sa_api.as_flask_sqlalchemy
Arguments
Requires
Argument | Type | Required | |
---|---|---|---|
db | _SQLAlchemyDB | _SQLAlchemyLiteDB_co | The db extension to be wrapped. | |
model_class | Type[_ModelLite_co] | The base model class used for mimicking the behavior of This value should not be used if |
- where
_SQLAlchemyDB
is aTypeVar
offsc.protocols.SQLAlchemyProtocol
. - where
_SQLAlchemyLiteDB_co
is aTypeVar
offsc.protocols.SQLAlchemyLiteProtocol
. - where
_ModelLite_co
is aTypeVar
ofsa.orm.DeclarativeBase
.
Returns
Argument | Type | |
---|---|---|
db | flask_sqlalchemy.SQLAlchemy | SQLAlchemyProxy(db, model_class) | If If |