Skip to content

sql

etl_craft.handlers.sql

HANDLER=SQL: wrap the task's read-only SELECT in one of eight actions on the warehouse.

The task supplies a SELECT, inline in SOURCE_SQL or as a file under the project's sql_files/ in SOURCE_SQL_FILE, and names its SQL_ACTION and TARGET_OBJECT; the engine owns every write. The parameters are checked first (spec), then the action uses the warehouse's transaction or publication strategy (actions), with every statement logged (session).

run

run(context: TaskContext, engine_db: Engine) -> HandlerResult

Run the SQL task described by context and return its counts.

task_dialect

task_dialect(context: TaskContext) -> WarehouseDialect

Choose the dialect: the warehouse connection and the task's table format.

The format is the task's TABLE_FORMAT parameter, else Warehouse.Table_format. Where the connection fixes the format (Trino, DuckDB over Iceberg), a task cannot choose another.