Fundamentals

Core concepts: two-part syntax, project structure, macros, snapshot-driven diffing, and name maps.
PageDescription
Two-Part SyntaxThe { } block model, no-verb mandate, structural scoping
Project StructureDirectory layout and dpg.toml configuration
MacrosNamed reusable fragments with the ...spread operator
Snapshots & DiffingOffline diffing, snapshot format, and safety classification
Name MapsTool-specific naming conventions for ORMs and code generators

Two-Part Syntax

Every DPG object has a PostgreSQL SQL definition (Part 1) and an optional structural block (Part 2).

Project Structure

Directory layout, cluster and database configuration, and dpg.toml reference.

Macros

Project-scoped reusable fragments spread into column lists or block bodies with ...name. Supports nested expansion; circular references are DPG-E012.

Snapshots & Diffing

How DPG computes migrations offline by diffing source against a committed snapshot, and how safety classification works.

Name Maps

Attach tool-specific naming conventions to DPG objects and columns for ORM generators, type-safe query builders, and other downstream consumers.