DatabaseEngineManager#

class safir.database.DatabaseEngineManager(config, connect_args)#

Bases: EngineManager

Manages 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_engine()

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 aclose on this object when the engine is no longer needed rather than calling the dispose method directly.

Returns:

Newly-created database engine.

Return type:

AsyncEngine

Overrides:

EngineManager.create_engine