engine
etl_craft.dialects.engine ¶
Engine DB dialects: PostgreSQL (recommended for production) and SQLite (the default).
EngineDialect ¶
Bases: ABC
One Engine DB: how to connect, lock, split scripts, and which SQL to run.
build_engine
abstractmethod
¶
Build a SQLAlchemy engine for profile, with no secret in its URL.
lock
abstractmethod
¶
Hold the cross-process lock key for the with body.
name identifies it in messages. With wait_seconds 0 it waits indefinitely;
otherwise it raises LockTimeoutError once that time has passed.
refresh_metadata_triggers
abstractmethod
¶
Install metadata capture and write guards for the current table definitions.
schema_problem ¶
Return why the Engine schema cannot be used, or None.
SQLite has one schema per file, and the file is created on first connect.
migrations_dir ¶
Return the directory of the packaged ENGINE migration stream.
split_statements ¶
Split a script into statements this database accepts one at a time.
migration_transaction ¶
migration_transaction(engine: Engine, *, rebuild_metadata: str | None = None) -> Iterator[Connection]
Apply a migration and its ledger row together, including any dialect's rebuild setup.
queries_dir ¶
Return this dialect's own queries directory; its files override shared ones.
query_path ¶
Return the file query name is read from; LookupError for an unknown name.
query ¶
Return the SQL text of query name.
Whole-line -- comments describe the query in its file and are left out, so a
comment may name a :parameter without the driver seeing a second one.
existing_tables ¶
Return which of names already exist as tables, in lower case and sorted.
for_name ¶
Return the dialect for a SQLAlchemy name such as postgresql+psycopg.
for_jdbc_url ¶
Return the dialect a JDBC URL names; raises ConfigurationError for any other.
for_engine ¶
Return the dialect engine is connected to.
build_engine ¶
build_engine(config: ConnectorConfig, profile: ConnectionProfile | None = None, **engine_kwargs: Any) -> Engine
Build a SQLAlchemy engine for profile, by default the active Engine profile.