# Exports

> Convert a data contract to SQL DDL, dbt, Avro, JSON Schema, HTML, Protobuf, and 20+ other formats.

# 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.

```bash
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](https://github.com/datacontract/datacontract-cli/issues).

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:

- [`examples/orders/orders.odcs.yaml`](https://github.com/datacontract/datacontract-cli/blob/main/examples/orders/orders.odcs.yaml) — an `orders` and `line_items` schema with a Snowflake and a BigQuery server. Used by most pages.
- [`examples/user_interactions/user_interactions.odcs.yaml`](https://github.com/datacontract/datacontract-cli/blob/main/examples/user_interactions/user_interactions.odcs.yaml) — a Databricks contract with DQX quality rules. Used by the [`dqx`](./dqx.md) page.

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

## Available exporters

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

See the [`export` command reference](../commands/export/index.md) for the common signature.
