Bronze Layer
The bronze layer is Rocky’s config-driven replication inside the warehouse. You write no SQL. Rocky finds the available tables, writes the SQL, and copies rows from the ingestion catalog into the target catalogs and schemas you declare.
The flow
Section titled “The flow”rocky discover → rocky plan → rocky apply- Discover. Finds the schemas and tables available for processing. A
fivetranadapter calls the Fivetran REST API for connectors and enabled tables. Aduckdbadapter queriesinformation_schema. Amanualadapter reads schema and table definitions written inline in the config. - Plan. Parses the source schema names, resolves target catalogs and schemas, and writes the SQL statements. Records the result as a deterministic plan, keyed by
plan_id. - Apply. Runs one plan by id. It creates catalogs and schemas, copies data, runs quality checks, and updates watermarks.
rocky runcollapses plan and apply into one call, for local work and automation.
Schema pattern parsing and target mapping
Section titled “Schema pattern parsing and target mapping”A schema_pattern on the pipeline source splits a source schema name into parts, and catalog_template and schema_template on the pipeline target fill from them. Example: fivetran_catalog.src__acme__us_west__shopify.orders with schema_template = "stage__{source}" and catalog_template = "warehouse" lands in warehouse.stage__shopify.orders. Full reference: Schema Patterns.
Auto-creation
Section titled “Auto-creation”Set auto_create_catalogs and auto_create_schemas under the target’s governance block. Rocky then creates the target catalog and schema before it copies anything:
[pipeline.bronze.target.governance]auto_create_catalogs = trueauto_create_schemas = true
[pipeline.bronze.target.governance.tags]managed_by = "rocky"Rocky applies governance.tags to the catalogs it manages, so a tag such as managed_by finds them later.
Incremental strategy
Section titled “Incremental strategy”The first run has no watermark, so it copies every row except the newest batch. Later runs copy rows newer than the stored watermark. The watermark column is _fivetran_synced by default (timestamp_column changes it). See SQL Generation and Incremental Processing.
On schema drift, a safe type widening becomes ALTER COLUMN TYPE, a new column becomes ALTER TABLE ADD COLUMN, and only an unsafe type change falls back to a full refresh. See Schema Drift.
Metadata columns
Section titled “Metadata columns”Declare metadata columns on the pipeline, beside strategy and timestamp_column:
[pipeline.bronze]type = "replication"strategy = "incremental"timestamp_column = "_fivetran_synced"metadata_columns = [ { name = "_loaded_by", type = "STRING", value = "NULL" }]Rocky appends them to the SELECT: SELECT *, CAST(NULL AS STRING) AS _loaded_by.
Because value becomes part of that statement, Rocky checks it when the config loads: it must be one expression, and any function it calls must be on the scalar-function allowlist. See metadata_columns for what passes and what does not.
Filtering
Section titled “Filtering”plan_id=$(rocky --config rocky.toml plan --filter tenant=acme --output json | jq -r .plan_id)rocky apply "$plan_id"This processes only the schemas whose parsed tenant is acme.
Related
Section titled “Related”- Schema Patterns: the full pattern and template reference
- Configuration: every
rocky.tomlkey