Skip to content

schema

etl_craft.engine.schema

init-db: applying the packaged schema to an empty Engine DB.

SENTINEL_TABLES module-attribute

SENTINEL_TABLES = ('cfg_pipelines', 'aud_pipelines_run_log')

Tables whose presence means the database already holds an Engine DB.

InitResult dataclass

What init-db did: statements applied, and packaged migrations recorded as included.

existing_engine_tables

existing_engine_tables(engine: Engine) -> list[str]

Return the Engine DB tables that already exist in this database.

init_db

init_db(engine: Engine, *, force: bool = False) -> InitResult

Apply the packaged schema to an empty database in one transaction.

The schema is plain CREATE statements, so a database that already has Engine DB tables is refused rather than failing halfway; migrate carries an existing one forward. force applies it anyway, for a database known to be empty apart from a leftover table. Packaged migrations are then recorded as applied, because the schema already includes them. Raises EngineDbError.