stamp_database_async¶
- async safir.database.stamp_database_async(engine, config_path=PosixPath('alembic.ini'))¶
Mark the database as updated to the head of the given Alembic config.
Add the necessary data to the database to mark it as having the current schema, without performing any migrations. It is intended to be called immediately after a fresh database initialization with the current schema.
The Alembic configuration must be
alembic.ini
in the current directory, and contain correct pointers to the database migrations.If running outside of an event loop, use
stamp_database
instead.- Parameters:
engine (
AsyncEngine
) – Database engine to use.config_path (
Path
, default:PosixPath('alembic.ini')
) – Path to the Alembic configuration.
- Raises:
AlembicConfigError – Raised if no migration heads could be found in the Alembic configuration.
- Return type: