Exports

datacontract export converts a data contract to a target format. Use it to generate DDL, schemas, models, documentation, and data-quality artifacts directly from the contract.

datacontract export html datacontract.yaml --output datacontract.html

Run datacontract export <format> --help to see the format-specific options (e.g. datacontract export sql --help). If a format you need is missing, open an issue on GitHub.

For SQL dialects (postgres, mysql, snowflake, databricks, sqlserver, trino, oracle, clickhouse), use datacontract export sql --dialect <dialect>.

Example contract

The examples on each export page are generated from the same data contract, so you can compare formats side by side:

Download a file and run the commands below against it to reproduce the output.

Available exporters

sqlSQL DDL (CREATE TABLE). sql-queryA SQL SELECT query. dbt-modelsdbt model schema YAML. dbt-sourcesdbt sources YAML. dbt-staging-sqlA dbt staging SQL file. avroAvro schema. avro-idlAvro IDL. jsonschemaJSON Schema. pydantic-modelA Pydantic model. protobufProtobuf schema. odcsODCS format. rdfRDF representation. htmlA standalone HTML page. markdownMarkdown documentation. mermaidA Mermaid diagram. bigqueryBigQuery schema. dbmlDBML. goGo structs. sparkSpark StructType schema. sqlalchemySQLAlchemy models. icebergIceberg schema. sodaclSodaCL checks. great-expectationsGreat Expectations suite. data-catererData Caterer data-generation task. dcsDCS format. dqxDatabricks DQX checks. excelODCS Excel template. customAny format, via a custom Jinja template.

See the export command reference for the common signature.