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
The Snowflake, BigQuery, Amazon Redshift, Postgres, MySQL, SQL Server, Oracle, Trino, Amazon Athena, Amazon S3, Google Cloud Storage, Azure Blob / ADLS, Databricks, and AWS Glue 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.
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
See the import command reference for the common signature.