- async safir.database.initialize_database(engine, logger, *, schema, reset=False)#
Create and initialize a new database.
AsyncEngine) – Database engine to use. Create with create_database_engine.
BoundLogger) – Logger used to report problems
MetaData) – Metadata for the database schema. Generally this will be
Baseis the declarative base used as the base class for all ORM table definitions. The caller must ensure that all table definitions have been imported by Python before calling this function, or parts of the schema will be missing.
False) – If set to True, drop all tables and reprovision the database. Useful when running tests with an external database.
DatabaseInitializationError – After five attempts, the database still could not be initialized. This is normally due to some connectivity issue to the database.
- Return type: