prefect.server.database.dependencies
Injected database interface dependencies
Functions
provide_database_interface
inject_db
db
kwarg and if a db is passed
when called it will be used instead of creating a new one.
db_injector
inject_db
, which injects the database connection as a keyword
argument, db_injector
adds it explicitly as the first positional
argument. This change enhances type hinting by making the dependency on
PrefectDBInterface explicit in the function signature.
When decorating a coroutine function, the result will continue to pass the
iscoroutinefunction() test.
Args:
func
: The function or method to decorate.
- A wrapped descriptor object which injects the PrefectDBInterface instance
- as the first argument to the function or method. This handles method
- binding transparently.
temporary_database_config
tmp_database_config
: Prefect REST API database configuration to inject.
temporary_query_components
tmp_queries
: Prefect REST API query components to inject.
temporary_orm_config
tmp_orm_config
: Prefect REST API ORM configuration to inject.
temporary_interface_class
tmp_interface_class
: Prefect REST API interface class to inject.
temporary_database_interface
tmp_database_config
: An optional Prefect REST API database configuration to inject.tmp_orm_config
: An optional Prefect REST API ORM configuration to inject.tmp_queries
: Optional Prefect REST API query components to inject.tmp_interface_class
: Optional database interface class to inject