DatabaseEngineManager#
- class safir.database.DatabaseEngineManager(config, connect_args)#
Bases:
EngineManagerManages a database engine and its associated resources.
This class should be created via
engine_manager, not directly.- Parameters:
config (
DatabaseConfig) – Connection configuration for the database.connect_args (
dict[str,Any] |None) – Additional connection arguments to pass directly to the underlying database driver.
Methods Summary
Create a new database engine.
Methods Documentation
- async create_engine()#
Create a new database engine.
Prefer using this class as a context manager instead where possible. If this method is used, the caller must call
acloseon this object when the engine is no longer needed rather than calling thedisposemethod directly.- Returns:
Newly-created database engine.
- Return type:
- Overrides: