dbt and data contracts
A data model already says which columns are required, which are unique, how tables relate, and which values a code may take. EntityModel.com turns that into the files data teams use to enforce it. All of these are under Export → Code.
dbt schema.yml
One dbt model per entity, with descriptions, data types and data tests:
| In the model | dbt test |
|---|---|
| Primary key | not_null and unique |
| Required attribute | not_null |
| Unique attribute | unique |
| Foreign key (relationship or reference) | relationships to the parent model |
| Reference list with values (up to 200) | accepted_values |
| PII flag | meta.pii |
Drop it into your dbt project's models/ folder next to the SQL models and run dbt test.
Source-to-target mappings also generate the dbt model SQL itself, from each target attribute's source columns and transform. See Mappings, glossary and comments.
ODCS data contract
An Open Data Contract Standard v3 contract describing the schema: objects and properties, logical and physical types, primary keys, PII classification, foreign keys, and valid values from reference lists as quality rules. Use it as the starting point of a producer–consumer agreement and add the service levels and ownership your team needs.
JSON Schema
JSON Schema 2020-12 with one definition per table under $defs: required properties, types, enums from reference lists and x-references for foreign keys. Useful for validating API payloads or JSON landing data against the model.
Avro
Avro record schemas, one per table, with logical date and timestamp types; optional columns are nullable unions. Useful for Kafka topics and schema registries.
From the command line
node bin/em.mjs export sales --format dbt --dialect snowflake --stdout > models/schema.yml
node bin/em.mjs export sales --format odcs
node bin/em.mjs export sales --format jsonschema
node bin/em.mjs export sales --format avro
Combined with model review in pull requests, this keeps the model, the tests and the contract in step: change the model, regenerate, and review all three together.