Skip to main content

Gallery

Every file in the repository's examples/ folder, rendered by the Docusaurus plugin exactly as your docs would render it. Each example focuses on one part of DBML; open one to explore the diagram and read its source.

01MinimalThe smallest useful diagram: two tables and one relationship.2 tables · 1 ref02E-commerceA small storefront that exercises every relationship form DBML offers: inline refs, short form, long form, all four cardinalities (<, >, -, <>), optional sides (?), composite foreign keys, named refs and referential actions.13 tables · 14 refs03Enums and notesEnums (public and schema-qualified, aliased, quoted values, value notes) and every place a note can go: project, table (both syntaxes), column, index, enum value. Multi-line notes use ''' strings and may contain Markdown.5 tables · 4 refs04Indexes and checksColumn settings, default value kinds, every index form (single, composite, expression, mixed, sort order, type, name, unique, pk, note) and check constraints (column-level and table-level, named).4 tables05Table groupsTableGroups: membership, color, note as a setting, note as a body field, custom properties, and a group holding schema-qualified tables.7 tables · 5 refs · 4 groups06Header colorsTable header colors (full #rrggbb and shorthand #rgb forms), relationship line colors in short and long form, and colors coming from a TablePartial.5 tables · 3 refs07Sticky notesSticky notes on the canvas: single-line, multi-line, colored, transparent (color: none), with custom properties, alongside a table note for contrast.2 tables · 1 ref · 5 sticky notes08Diagram viewsSeveral named DiagramView blocks over one schema: everything, nothing, a hand-picked table list, and views mixing tables, sticky notes, table groups and schemas.7 tables · 4 refs · 2 groups · 2 sticky notes · 5 views09Table partialsTablePartials: reusable columns, settings and indexes injected with ~name. Shows conflict resolution: local definitions beat partials, later partials beat earlier ones.4 tables · 3 refs10RecordsSample data with records: outside a table with a column list, inside a table with explicit and implicit column lists, every value type (string with escapes, numbers, booleans in several spellings, null forms, dates/timestamps, enum constants, backtick expressions) and [example] records.5 tables · 3 refs11Multiple schemasSeveral schemas: schema.table names, schema-qualified enums, table aliases, cross-schema refs in inline, short and long form, and the implicit public schema.8 tables · 8 refs · 1 group12Modules (multi-file)Entry point of a multi-file project: `use *` from a barrel that re-exports with `reuse`; selective `use { ... }` with element kinds and `as` aliases; importing a whole schema and a table group; Metadata blocks adding properties to imported elements.9 tables · 8 refs · 1 group · 1 sticky note · 1 view13Project settings and metadataProject block, front matter, custom properties (inline and via Metadata blocks for every supported target kind), property value types, and inactive refs.4 tables · 5 refs · 2 groups · 1 sticky note14Large schemaGenerated-looking multi-tenant SaaS schema (~60 tables) for layout and render performance tests. Plain public schema, inline refs, table groups with colors.61 tables · 94 refs · 7 groups · 2 views