Data model

Databases, schemas, tables, rows, types, and constraints in PLOMID v0.1.0.

Version
Latest
v0.1.0 · latest 1 min read
On this page
  1. Hierarchy
  2. Columns
  3. Identity and constraints
  4. Related
diagram
flowchart TB
    DB["database\nisolated storage root"] --> SC["schema\nnamespace (public default)"]
    SC --> TB["table\ncolumns + rows + indexes + constraints"]
    TB --> RW["row\nPgValue per column, NULL bitmap on disk"]
    TB --> IX["index\nB-tree (durable) + ART (transient)"]
Diagram source · mermaidcopy included
mermaidsource
flowchart TB
    DB["database\nisolated storage root"] --> SC["schema\nnamespace (public default)"]
    SC --> TB["table\ncolumns + rows + indexes + constraints"]
    TB --> RW["row\nPgValue per column, NULL bitmap on disk"]
    TB --> IX["index\nB-tree (durable) + ART (transient)"]

Hierarchy#

textsource
database
└── schema (public by default)
    └── table (columns + rows + indexes + constraints)
  • Database: isolated storage root (see First database).
  • Schema: namespace; search_path resolves unqualified names ("$user",public default).
  • Table: ordered column definitions + heap of versioned rows.
  • Row: PgValue per column (crates/types/src/value.rs), NULL bitmap on disk (crates/storage/src/row.rs).

Columns#

sqlsource
CREATE TABLE products (
  id         BIGINT PRIMARY KEY,          -- integer + unique enforcement
  sku        TEXT NOT NULL UNIQUE,
  price      NUMERIC(12,2) NOT NULL DEFAULT 0.00,
  tags       TEXT[] ,                     -- array type
  spec       JSONB,                       -- document column
  created_at TIMESTAMPTZ NOT NULL DEFAULT now()
);

Column types: Types. Constraints: Constraints. serial/bigserial auto-create <table>_<col>_seq and mark serial=true.

Identity and constraints#

  • PRIMARY KEY / UNIQUE → persistent B-tree + transient unique-gate reservation (durable authority is the index; see Indexes).
  • NOT NULL, DEFAULT <expr>, CHECK (expr) enforced at write time.
  • Foreign keys parse in some DDL paths but are not enforced in v0.1.0 — see Compatibility.

Create a table · JSON · Temporal

Was this page helpful?