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.

# 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

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.

Example sources

Each import page shows a runnable example: a small source file under 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

sqlA SQL DDL file. dbtA dbt manifest file. avroAn Avro schema file. dbmlA DBML file. glueAWS Glue Data Catalog. bigqueryGoogle BigQuery (file or API). unityDatabricks Unity Catalog. jsonschemaA JSON Schema file. jsonA JSON data file. odcsAn ODCS data contract file. parquetA Parquet file. csvA CSV file. protobufA Protobuf schema file. sparkA Spark schema / DataFrame. icebergAn Iceberg schema. excelAn ODCS Excel template. powerbiA Power BI semantic model (.pbit, .bim, or .json). snowflakeA Snowflake workspace.

See the import command reference for the common signature.