Skip to content


Groups of SQL Domains are Entities

An SQLa entity is a concrete instance of a group of domain instances such as attributes or properties. An entity is usally a table in SQL but might also be represented as a view or a stored function.


  • Table in render/ddl/table/mod.ts
  • Enum Table in pattern/enum-table.ts (text key, numeric values, automatic seeds)
  • Enum Table in pattern/enum-table.ts (type-safe text key, text values, automatic seeds)
  • Data Vault 2.0 Tables in pattern/data-vault.ts (build on Immutable Table patterns)
  • Immutable Table (see Data-Oriented Programming patterns)
  • Association Table (M:M relationship between two entities)
  • Unified Star Schema (USS) “presentation layer” measures, bridges, etc.

Entities (Table) Capabilities

  • identity
  • columns (“attributes”) declared as domains
  • primary key(s)
  • foreign key references (outbound)
  • columns referenced as foreign keys (inbound, aggregations, to define 1:M , 1:1, M:1 “links”)
  • Zanzibar (Permify style) ACLs definition in entities and enforcement in SQL
  • table labels/tags for grouping of tables like domain labels group columns
    • rollup sensitive-labeled columns and auto-label tables as sensitive
    • rollup identity-labeled (PII, PHI) columns and auto-label tables as PII/PHI
  • JSON Schema (from Zod)
  • Invisible XML schema
  • CSV Schema, examples