Skip to main content

Export: dbt Staging SQL

Generates a dbt staging SQL file that selects the contract's fields.

datacontract export dbt-staging-sql orders.odcs.yaml --schema-name orders

Running this against the example orders contract produces:

select
order_id, order_timestamp, customer_id, order_total, status
from {{ source('urn:datacontract:checkout:orders', 'orders') }}

For fully customized staging models, use the custom exporter with a Jinja template.

All options: datacontract export dbt-staging-sql.