Skip to content

Shared DDL families

Two families emit definition statements rather than loads: the CREATE TABLE family, which renders for any table in the catalog regardless of layer, and the schema family, the smallest contract in the engine.

Templates: databricks/shared/create_table.jinja, fabric/shared/create_table.jinja, snowflake/shared/create_table.jinja

Roots: table, options, build

The CREATE TABLE family, and the richest single root in the engine: table carries the whole modeling picture (columns, keys, references, business meaning, governance) plus a computed SQL namespace with the finished, aligned DDL per platform. It renders for any table in the catalog regardless of layer.

FieldTypeMeaning
table.namestringThe table’s name.
table.schemastringThe resolved schema name; dbo when the table carries none.
table.descriptionstring?The table comment.
table.dataLayerstringThe table’s functional layer slug; empty when unset.
table.kindstringThe vault entity kind (hub, link, satellite, and so on); empty when unclassified. Branch on it with {{ table.kind }}.
table.customobjectOrg-defined custom attribute values at table grain; keys without a live definition never appear.
table.connection.namestringThe table’s connection (required: a table with no resolvable connection refuses to render).
table.connection.connectionTypestringConnector type (for example Azure Databricks, Snowflake).
table.connection.catalogstring?Default catalog; also the catalog_name widget default.
table.connection.defaultSchemastring?Connection default schema.
table.businessEntityobject?Conditional: the linked business entity: name, description, knownAs (pipe-joined synonyms), classifications (pipe-joined free-form labels, a historical name), tags.
table.governanceobject?Conditional: entity-grain governance: entityName, classifications ({schemeKey, valueKeys} assignments), definitionStatus, retentionPolicy, freshnessTarget, owner and steward (resolved display names, never raw identifiers; dropped when the user is gone).
FieldTypeMeaning
columns[].namestringColumn name.
columns[].dataTypestringRaw declared data type (before platform rendering).
columns[].length / .precision / .scalenumber?Declared size facets, when the type carries them.
columns[].ordinalnumberColumn position; also the emitted sort order.
columns[].isNullable / .isPrimaryKey / .isBusinessKeybooleanNullability and key flags.
columns[].descriptionstring?Column comment.
columns[].transformationstring?The transformation expression with macro tokens already resolved.
columns[].isIgnoredboolean?Excluded from generation when true.
columns[].changeTypestring?Change-tracking behavior marker.
columns[].referencesobject?Conditional: the resolved foreign-key target: table and column names (never identifiers) plus constraintName when declared. Absent for self-references and unresolvable links.
columns[].businessAttributeobject?Conditional: the mapped business attribute: name, description, classifications, definitionStatus (Approved drives governance_certified), plus the parent entity’s classifications and status for the fallback tier.
columns[].customobjectCustom attribute values at column grain.
columns[].sql.tagsMap[]{key, value}[]Per-column governance tags: classification scheme keys, governance_certified, business_attribute. Values pre-escaped for interpolation inside a SQL string literal.
columns[].sql.tagCountnumberTag count; test the count, never the array.
columns[].sql.safeNamestringThe sanitized identifier the tag block emits.

Always computed by the engine; a pasted context’s table.sql, columns[].sql, and options.widget are discarded and recomputed, so these values are never stale.

FieldTypeMeaning
table.sql.qualifiedNamestringThe parameterized table reference: IDENTIFIER() over the catalog_name binding, schema, and name.
table.sql.qualifiedNameInExecstringThe same reference spelled for use inside a SET VARIABLE exec_sql body.
table.sql.primaryKeyColumns / .primaryKeyColumnsSafestring[]Primary-key column names, raw and sanitized, index-aligned.
table.sql.clusterByColumns / .clusterByColumnsSafestring[]CLUSTER BY candidates: non-binary primary keys, else the first non-binary business key, else empty. Raw and sanitized, aligned.
table.sql.primaryKeyConstraintNamestringThe ADD CONSTRAINT name (PK_ plus schema and name, sanitized).
table.sql.tagsMap[]{key, value}[]Table-level tags derived from the business entity (BusinessName, KnownAs, Classifications, Tags), each emitted only when non-empty, values pre-escaped.
table.sql.descriptionEscapedstringThe table comment through SQL escaping; empty when there is none.
table.sql.columnCount / .primaryKeyCount / .clusterByCount / .tagCountnumberPrecomputed sizes; branch on these, not on array truthiness.
table.sql.ddl.databricks / .snowflake / .fabricblockThe finished, aligned CREATE TABLE block per platform (see the aligned DDL column), measured independently because the three platforms quote and render types differently. Each column entry also carries description and descriptionEscaped so a COMMENT still gates on the raw value.

Per-field resolution: engine defaults, then the organization’s build settings, then the per-table override.

FieldTypeMeaning
options.addPrimaryKeysbooleanEmit PRIMARY KEY constraints; default true.
options.addSqlCommentsbooleanEmit COMMENT clauses; default true.
options.addSqlTagsbooleanEmit SET TAGS blocks; default true.
options.tableOwnerstring?Table owner principal (per-table, else the build setting). Non-empty declares the table_owner widget.
options.targetDisplayTimeZonestringDisplay time zone; empty means no SET TIME ZONE.
options.locationClause / .partitionedByClause / .tableProperties / .optionClause / .clusterByClausestring?Free-form clause overrides from the table’s options (tableProperties falls back to the build setting).
options.storageLocationstring?Per-table storage location from the layer’s catalog when default storage is off. Non-empty declares the location_path widget and emits LOCATION; empty means a managed table.
options.widget.paramsstring[]Ordered widget parameter names: always catalog_name first, then location_path and table_owner when applicable.
options.widget.declareBlocksstring[]One finished DECLARE plus SET VARIABLE line per parameter, index-aligned with params, defaults pre-escaped.
options.widget.paramsClausestringThe parameters joined with a comma: the opening SELECT line, precomputed.

The build root is the shared build settings record, resolved at organization scope (this family has no single project scope).

Templates: snowflake/shared/create_schema.jinja

Roots: schema

The smallest contract in the engine: one name.

FieldTypeMeaning
schema.namestringThe schema being created.