Most schemas contain the same few things: users and sessions, a billing setup, an audit log, webhooks from a payment provider. Templates help when you start a diagram. Snippets help after that, when you need one of those pieces in a schema that already exists.
Dropping one in
Open the command palette (Cmd or Ctrl and K) and choose "Insert snippet…", or choose Snippet on an empty branch's start card. The picker holds about a hundred snippets in twelve categories: Payment providers, Billing, Auth & identity, Teams & access, Platform patterns, Content & collaboration, Messaging, Integrations & sync, AI, Product & growth, Commerce and Places. Search covers names, tags, categories, descriptions and table names, so "Stripe", "invitations" or "audit" find what you'd expect.
The picker only shows snippets written for your diagram's engine. Most are portable and get their types respelled for the engine (and any RLS left out where the engine has none); a few, such as ones that need pgvector or Supabase's auth schema, are PostgreSQL only and don't appear elsewhere.
Pick one and press its "Use" button ("Use Audit log", say), and the next step asks two things.
What it connects to. A snippet that refers to something outside itself, like whoever pays for a subscription, has a placeholder. Each placeholder is a dropdown of your tables, with the best guess already chosen (your orgs, workspaces or users, say), plus an option to create a new table instead. The foreign key that points at it takes the type of that table's primary key, so a bigint key gets a bigint column.
Where its tables go. On engines with schemas you choose "Its own" schema or an "Existing" one, and you can add a "Table prefix" to every name. Provider snippets suggest their own schema, stripe for Stripe, and switch to a stripe_ prefix if you put them in an existing schema. The step lists the tables it will add, and anything that doesn't fit your branch shows there before you go on.
"Review changes" then opens the merge review, labelled with the snippet's name, where you see every table, column, key and index it adds. Apply it and the editor groups the new tables under the snippet's name and lays them out together.
A worked example: an audit log
Say you have users, projects and invoices, and someone asks who changed an invoice last week. Search for "audit", pick Audit log, and leave its "Who acts" placeholder on your users table. It adds one table, audit_events:
id, auuidprimary key defaulting togen_random_uuid()actor_id, a nullable foreign key touserswithon delete set null, so removing a person keeps their historyaction,target_typeandtarget_idas text, which lets one table point at any recordbeforeandafterasjsonb, for the row on either side of the changeip_address,user_agentandrequest_id, all optionalcreated_at timestamptzdefaulting tonow()
It comes with three indexes: on (target_type, target_id) for "what happened to this record", on actor_id for "what did this person do", and on action.
Select audit_events and the Inspector says where it came from: "From Audit log v1", with an Unlink link if you'd rather the table stopped tracking the snippet.
Provider snippets
Snippets that mirror a payment provider follow the same rules everywhere. They keep the provider's ids as text primary keys (cus_...), store money as integers in minor units beside a currency, keep the last payload in a raw column, and include an events table whose id makes webhook handling idempotent: the same event delivered twice is one row.
Stripe billing, for example, adds customers, products, prices, subscriptions, subscription_items, invoices, invoice_line_items, payment_methods and events, with enums for price type, billing interval, subscription status and invoice status. Its "Who pays" placeholder links customers to your own table.
Each provider snippet says which API version it matches and when it was last checked, on a line like "Matches Stripe API ... · reviewed ...". Provider snippets are due for review every 90 days and design patterns every 365; one that's overdue, or that people have reported, shows a "May be out of date" badge. Every snippet has a "Report a problem" link in the picker and the Inspector.
Staying up to date
Each table a snippet added remembers which snippet, which version and which insertion it came from. That record follows the table through branches, forks, undo and version snapshots. When a newer version is published, the Inspector shows "Audit log v2 is available" (or whichever snippet it is) with a line on what changed, Health lists it, the table card shows a badge, and the command palette offers it.
"Review update" works out what changed between the version you inserted and the latest, then lays only that over your tables as they are now. Columns you added stay. An edit from the update that no longer fits (it changes a column you've already dropped, say) comes back as a warning rather than a change. As always, the result opens in the merge review first.
If you don't want an update, "Skip this version" records that, and it won't be offered again. A version after it will be.
Your own library
Select some tables and choose "Save selection as snippet…" from the command palette, or "Save as snippet…" in the Inspector when several tables are selected. Give it a name and a one-line description. Foreign keys to tables outside the selection become placeholders automatically, so the next diagram can connect them to its own tables.
Tick "These tables become the snippet's, and are offered its new versions" and the tables you saved from are linked as version 1. When the pattern changes, edit those tables and press "Publish changes as v2" in the Inspector. Every diagram in the workspace that inserted it is offered the update. If someone else published in the meantime, publishing refuses rather than overwriting their version.
Saved snippets appear in the picker under "Your workspace" and are managed in Settings → Snippets, where the author and the workspace's owners and admins can rename, archive and restore them. An archived snippet keeps working where it's already used but isn't offered any more. The Free plan keeps 3 saved snippets and Pro keeps 25; Team and Enterprise have no cap. A table keeps a saved snippet's link only inside that workspace, so copying or moving the diagram elsewhere drops it.
Column kits
Smaller still: kits add a set of columns to the tables you choose, without adding tables or leaving a link. Select one or more tables and open "Column kit" in the Inspector, or use "Add ... columns…" in the command palette. There are seven:
- Soft delete: a nullable
deleted_at timestamptz, indexed. - Updated at:
updated_at timestamptzdefaulting tonow(). - Optimistic locking:
version intstarting at 1, with a check that it stays at 1 or above. - Tenant: a
tenant_idforeign key to your tenants table withon delete cascade, an index and, on PostgreSQL, row level security with a tenant isolation policy. - Created by: a nullable
created_bypointing at your users, kept as null when that person is deleted. - External id:
external_sourceandexternal_id, unique together, for syncing with another system. - Sort order:
position intdefaulting to 0, indexed.
Index and policy names are made per table, so the Soft delete kit on invoices adds invoices_deleted_at_idx. A column a table already has is skipped, with a warning. Like everything else, the result is reviewed before it's applied.