# Imports

> Create a data contract from an existing schema such as SQL DDL, dbt, BigQuery, Glue, or Excel.

# Imports

`datacontract import` creates a data contract from an existing source format. This is the fastest way to bootstrap a contract from a system you already have.

```bash
# Import from a SQL DDL file
datacontract import sql --source my_ddl.sql --dialect postgres

# Save the result to a file
datacontract import sql --source my_ddl.sql --dialect postgres --output datacontract.yaml
```

The [Snowflake](./snowflake.md), [BigQuery](./bigquery.md), [Amazon Redshift](./redshift.md), [Postgres](./postgres.md), [MySQL](./mysql.md), [SQL Server](./sqlserver.md), [Oracle](./oracle.md), [Trino](./trino.md), [Amazon Athena](./athena.md), [Amazon S3](./s3.md), [Google Cloud Storage](./gcs.md), [Azure Blob / ADLS](./adls.md), [Databricks](./databricks.md), and [AWS Glue](./glue.md) importers can connect directly to the live system and introspect your tables — no export files needed. Snowflake, BigQuery, Redshift, Postgres, MySQL, SQL Server, Oracle, Trino, Athena, S3, GCS, ADLS, and Databricks also generate a ready-to-test `servers` block, so `datacontract test` works right after the import.

Run `datacontract import <format> --help` to see the format-specific options (e.g. `datacontract import sql --help`). If a format you need is missing, [open an issue on GitHub](https://github.com/datacontract/datacontract-cli/issues).

## Example sources

Each import page shows a runnable example: a small source file under [`examples/imports/`](https://github.com/datacontract/datacontract-cli/tree/main/examples/imports) and the data contract the CLI generates from it. Download a source and run the command on the page to reproduce the output.

## Available importers

  
    
    adlsFiles in Azure Blob Storage.
  
  
    
    athenaAn Amazon Athena database.
  
  
    
    avroAn Avro schema file.
  
  
    
    bigqueryGoogle BigQuery (file or API).
  
  
    
    csvA CSV file.
  
  
    
    databricksDatabricks Unity Catalog.
  
  
    
    dbmlA DBML file.
  
  
    
    dbtA dbt manifest file.
  
  
    
    excelAn ODCS Excel template.
  
  
    
    gcsFiles in Google Cloud Storage.
  
  
    
    glueAWS Glue Data Catalog.
  
  
    
    icebergAn Iceberg schema.
  
  
    
    jsonA JSON data file.
  
  
    
    jsonschemaA JSON Schema file.
  
  
    
    mysqlA MySQL database.
  
  
    
    odcsAn ODCS data contract file.
  
  
    
    oracleAn Oracle database.
  
  
    
    parquetA Parquet file.
  
  
    
    postgresA Postgres schema.
  
  
    
    powerbiA Power BI semantic model (.pbit, .bim, or .json).
  
  
    
    protobufA Protobuf schema file.
  
  
    
    redshiftAn Amazon Redshift schema.
  
  
    
    s3Files in an Amazon S3 bucket.
  
  
    
    snowflakeA Snowflake workspace.
  
  
    
    sparkA Spark schema / DataFrame.
  
  
    
    sqlA SQL DDL file.
  
  
    
    sqlserverA SQL Server database.
  
  
    
    trinoA Trino catalog.
  

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