Blog/Announcements

Linked databases: know when production drifts

Link a diagram to the database it describes, let each branch track a target, and see within the hour when the two stop matching.

Announcements6 min read

A diagram is only useful while it matches the database it describes. Someone runs a hotfix in a console, a migration goes out from a different branch, and the diagram is quietly wrong. Nobody notices until a new starter builds a feature against a column that was renamed a month ago. Linked databases fix that by watching.

Open the overflow menu in the editor's top bar and pick "Linked database…" (it's also in the command palette). Only the diagram's owners and maintainers can link.

There are three kinds of link.

A Supabase project links through your workspace's Supabase connection. A workspace owner or admin connects the Supabase organisation once in Settings → Integrations. After that, in the Linked database dialog, you pick the Project, tick the Schemas to read and press Link project. No database password is involved: the app reads the catalog through Supabase's read-only query endpoint for that project. Supabase links need a PostgreSQL diagram.

Any other database links through a saved connection. Under "Any other database", Import from database… opens the live import wizard. Read the database there, and on the last step tick "Keep as the linked database, to pull again and hear when it changes". The connection is stored encrypted, used only to read the schema, and deleted when you unlink.

If your workspace has a vault and you have it unlocked, that same step offers "Keep the credentials" with two choices: "Sealed in the vault" (the default) or "Managed". A sealed connection is encrypted in your browser and our servers can't open it. That changes how drift is checked, which comes up below.

One diagram has one link. A read takes up to 20 schemas (or MySQL databases, or Oracle owners) at once. The first one is the diagram's home and its tables keep bare names.

A branch tracks a target

The link says where the database is. Each diagram branch then decides whether to follow it.

For a Supabase project, a branch can track the project's default branch or any of its preview branches. main might track production while add-billing tracks a preview branch called add-billing. When a diagram branch doesn't track anything yet, the Track picker suggests the Supabase branch with the same name (or the one made for a Git branch of that name), and otherwise the default. Press "Track this instead" to switch, or "Stop tracking" to stop.

A saved connection has one target, so only the diagram's default branch can track it. If you change which branch is the default, the track moves with it. A feature branch can still pull from the saved connection, but each pull is a one-off read and changes aren't watched there.

A branch that tracks nothing isn't watched. The dialog shows this per branch: the open branch at the top (for example "main tracks" followed by the link's name or a Supabase branch, or "main doesn't track the database"), and every other branch under "Other branches" with what it tracks.

Changing what a branch tracks starts it fresh: its last pull and its drift are cleared.

Drift, shown where you work

Once an hour, the app reads every tracked target and compares it with what each branch last pulled. When they differ, the editor's top bar shows "Database changed" on that branch, and its row in the dialog shows a Changed badge. Hover the badge to see when the change was first seen.

The comparison is a SHA-256 fingerprint of the schema the read returns, written in a canonical form: keys sorted, and lists of objects sorted, so a catalog that returns rows in a different order doesn't count as a change. Rows aren't part of it, so a table that only gained data doesn't count either. A new column, a changed default, a dropped index or an edited policy does.

There's a catch worth knowing: a branch starts being watched after its first pull. Until then the dialog says "pull once to start watching for changes", because there's nothing yet to compare against.

Some links aren't checked hourly:

  • Sealed links. The server can't open them, so instead a member with the vault unlocked checks it when they open a branch that tracks it, at most once an hour.
  • Links in a workspace that no longer has database sync on its plan.
  • Supabase links whose workspace connection is broken.

If a check fails, the dialog says "Last check failed:" with the reason, such as the database rejecting the password, instead of the driver's raw error.

Pulling a change in

Here's a worked example. Your diagram's main branch tracks production, and you pulled last week. On Tuesday someone fixes a bug straight in the database console:

alter table orders add column refunded_at timestamptz;
create index orders_refunded_at_idx on orders (refunded_at);

At the next hourly check, main shows "Database changed". To bring it in:

  1. Click the badge, or open Linked database… from the overflow menu.
  2. The dialog explains that the schema has changed since this branch's last pull. Press "Pull changes".
  3. The merge editor opens with the live database as the source, labelled "Live (…)" with the link's name, and main as the target. It lists the new refunded_at column and the new index as separate changes, all ticked.
  4. Untick anything you don't want, and apply.

Nothing is overwritten without that review. Tables are matched by name and updated in place, so positions, groups and comments stay put.

Applying records the read as pulled, and the badge clears. That happens even if you unticked some changes: you've reviewed this version of the database, so it won't keep flagging the same difference. Close the review without applying and the flag stays.

Pulls into an empty branch skip the review: the schema comes straight in and is laid out like an import.

For a Supabase link with several branches, the dialog also has a "Pull from" picker. Pulling from a different Supabase branch than the one you track reads it once, and the dialog says changes are still watched on the tracked one.

Starting a diagram from a database

New diagram has a "Connect a live database" option. It runs the same import wizard on a new, empty diagram, keeps the connection as the link (or links a Supabase project through the workspace's connection), fills the diagram from it with a laid-out canvas, sets the diagram's engine and host to match what it read, and opens it. From then on its default branch is watched like any other.

Edit in the dialog renames the link, changes which schemas it reads, or points it at another connection. Each branch keeps what it tracks. Switching to another Supabase project or another connection starts their pulls again, because the old fingerprints no longer mean anything.

Unlink removes the link and every branch's track. For a saved connection, the encrypted connection is deleted too. A sealed connection stays in the workspace vault until someone deletes it from Settings → Vault. Moving the diagram to another workspace drops a Supabase or sealed link, since both belong to the old workspace.

What it needs

  • A plan with database sync (Pro and up).
  • Owner or maintainer rights to link, edit, unlink or change what a branch tracks. Pulling needs edit access.
  • For anything other than Supabase, a database the app can reach. A saved or managed connection is read from our servers, so the host must resolve to a public address. A database on a private network can be read through the local agent and kept sealed in the vault.

Reads, including pulls and the import, count towards a limit of 20 every ten minutes per person. Credentials are encrypted at rest, and no query in the app returns them to a browser.

More announcements

  • Convex schemas, in and out

    19 November 2026 · 6 min read

    Export a diagram as convex/schema.ts from any engine, paste one in, or check one out from a repository, and what happens to the parts Convex can't hold.

  • Snippets: drop-in table sets that stay up to date

    10 November 2026 · 6 min read

    About a hundred ready-made table sets for payments, auth, teams and more, inserted into the schema you already have and updated without losing your edits.

  • A vault we can't open, and a local agent

    6 November 2026 · 6 min read

    Database credentials sealed in your browser with a workspace key our servers never see, and a small agent that reads databases from your own machine.

Try it on your own schema

One diagram with two branches, no card needed. Upgrade when your team needs more.