Skip to main content

Project settings and metadata

Project block, front matter, custom properties (inline and via Metadata blocks for every supported target kind), property value types, and inactive refs.

Covers: Front matter; Project with database_type and Markdown note; inline custom properties on tables, columns, groups, sticky notes and refs with every value type (string, number incl. decimal and negative, boolean, color); Metadata blocks for Table, Column, TableGroup, Note and Ref (named refs); inactive refs in short and long form, combined with other settings

13-project-settings-and-metadata.dbml
13-project-settings-and-metadata.dbmlpublishingpublishingg1g1reminderRemember to review thisschemapublic.posts.editor_id > public.users.id (inactive)public.post_revisions.revised_by > public.users.id delete: set null (inactive)public.posts.legacy_author_id > public.users.id (inactive)user_posts: public.posts.user_id > public.users.id delete: cascadepost_history: public.post_revisions.post_id > public.posts.id delete: cascadeusers scott is the ownerusershas noteid int · primary keyidintemail varchar · unique · not nullemailUNNvarchardisplay_name varchardisplay_namevarcharcreated_at timestamp · default: now()created_attimestamppostspostsid int · primary keyidintuser_id int · foreign key · not nulluser_idNNinteditor_id int · foreign keyeditor_idintlegacy_author_id int · foreign keylegacy_author_idinttitle varchar · not nulltitleNNvarcharstatus varchar · default: draftstatusvarcharpost_revisionspost_revisionsid int · primary keyidintpost_id int · foreign key · not nullpost_idNNintrevised_by int · foreign keyrevised_byintbody textbodytexttagstagsid int · primary keyidintname varchar · uniquenameUvarchar

Source​

examples/13-project-settings-and-metadata.dbml
examples/13-project-settings-and-metadata.dbml
---
title: Content platform
owner: data-team
updated: 2026-10-12
---
// Project block, front matter, custom properties (inline and via Metadata blocks for
// every supported target kind), property value types, and inactive refs.

Project content_platform {
database_type: 'PostgreSQL'
Note: '''
# Content platform
Annotated with custom properties for the data catalog.
'''
}

Table users [owner: "data-team", sla_hours: 24, pii: true, brand_color: #3498DB] {
id int [pk, masking: "partial"]
email varchar [not null, unique, classification: "confidential"]
display_name varchar
created_at timestamp [default: `now()`]
}

Table posts [owner: 'editorial', weight: 0.75, offset: -1] {
id int [pk]
user_id int [not null]
editor_id int
legacy_author_id int [deprecated: true]
title varchar [not null]
status varchar [default: 'draft']
}

Table post_revisions {
id int [pk]
post_id int [not null]
revised_by int
body text
}

Table tags {
id int [pk]
name varchar [unique]
}

TableGroup publishing [team: "growth", color: #79AD51] {
posts
post_revisions
tags
}

TableGroup g1 {
users
}

Note reminder [author: "docs", color: #F4D03F] {
'Remember to review this schema'
}

// Inline custom properties on a ref, mixed with standard settings.
Ref user_posts: posts.user_id > users.id [delete: cascade, owner: "data-team"]
Ref post_history: post_revisions.post_id > posts.id [delete: cascade]

// Inactive refs: drawn dotted, documented but not the focus.
Ref: posts.editor_id > users.id [inactive]
Ref: post_revisions.revised_by > users.id [delete: set null, inactive]
Ref {
posts.legacy_author_id > users.id [inactive, color: #999999]
}

// Metadata blocks: properties declared away from the element.
Metadata Table users {
owner: 'scott'
note: 'scott is the owner'
}

Metadata Column users.id {
pii: true
masking: 'partial'
}

Metadata Column posts.title {
searchable: true
max_display_chars: 80
}

Metadata TableGroup g1 {
team: 'growth'
color: #3498DB
}

Metadata Note reminder {
due: '2026-12-01'
priority: 2
}

Metadata Ref user_posts {
owner: 'reporting'
critical: true
}

Metadata Ref post_history {
retention_days: 365
}