On this page
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
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#
database
└── schema (public by default)
└── table (columns + rows + indexes + constraints)- Database: isolated storage root (see First database).
- Schema: namespace;
search_pathresolves unqualified names ("$user",publicdefault). - Table: ordered column definitions + heap of versioned rows.
- Row:
PgValueper column (crates/types/src/value.rs), NULL bitmap on disk (crates/storage/src/row.rs).
Columns#
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.
Related#
Was this page helpful? Thanks — noted locally, nothing is sent anywhere.