Open source — MIT license

arc-tables

Point it at any Postgres or Supabase database.
Get beautiful interactive HTML maps and a plain-English audit with the exact SQL to fix every issue.

Get started View on GitHub
arc-tables — zsh
$ arc-tables connect supabase --project pqwfnhblts --as arc-prod
✔ Connected to arc-prod (166 tables, 12 views)

$ arc-tables audit --profile arc-prod --format cards --output audit.html
Introspecting schema public...
Running 9 audit rules across 166 tables...
✔ Found 144 issues — 12 errors · 67 warnings · 65 info
✔ Wrote card report: audit.html
✔ Wrote SQL: fixes.sql

$ open audit.html
Schema visualization

Your database at a glance

Every table, every foreign key, color-coded by group. Hover to isolate. Click to explore. All in a single HTML file — no server, no deps.

companies
iduuid
company_nametext
domaintext
contacts
iduuid
full_nametext
emailtext
leads
iduuid
company_iduuid
stagetext
clients
iduuid
company_iduuid
lead_iduuid
created_atts
activebool
client_contacts
client_iduuid
contact_iduuid
client_transactions
iduuid
client_iduuid
amountint
stripe_clients
client_iduuid
stripe_idtext
FK link
PK
FK
text
int
🗺
Full ecosystem map
Every table laid out with color-coded groups, animated FK flow lines, and hover-to-isolate. Single HTML file, no server needed.
📊
Lifecycle flow diagrams
Trace how data moves from leads through to clients and transactions. Pick any path through your schema and get a focused flow view.
🧾
Plain-English audit cards
Tinder-style issue review. Each card explains the problem, why it matters, and the fix in plain English — not just the raw SQL.
🔗
Diagram per issue
Every audit card has a diagram button that centers the affected table on an interactive canvas with all FK neighbors. Pan & zoom to explore.
Audit review

Issues, not noise

One card at a time. Accept the fix, skip it, or dismiss. Notes persist to localStorage. Each card links to a live diagram of the affected table.

connection
⚠ warning
client_information . client_name
This column uses a name to link tables instead of an ID

What: client_information.client_name references clients.name as text instead of using clients.id.

Why it matters: If a client is ever renamed, this link silently breaks. Name-based joins are also slower and can't enforce referential integrity.

Fix: Add a client_id uuid column with a real FK constraint, backfill from the name match, then drop the old text column.

✗ Dismiss
Skip
✓ Accept fix
issue 7 of 144 · 3 accepted · 1 dismissed
🏷 naming
🧹 cleanup
🔗 connection
🏗 structure
❌ broken
Session progress
Total issues 144
3
Accepted
1
Dismissed
140
Remaining

Three commands, full picture

01
Connect
Point arc-tables at your Supabase project or Postgres connection string. Credentials stay on your machine.
02
Introspect
Reads all tables, columns, foreign keys, views, and indexes. No schema changes, read-only queries only.
03
Generate
Outputs a self-contained HTML file. Map, flow diagram, or card-based audit report — your choice.
04
Fix
Review the issues in your browser. Accept fixes to build a fixes.sql file. Run it when you're ready.
Built-in audit rules

9 rules, zero config

Every rule ships with the exact SQL to fix the problem and plain-English explanations anyone can read.

01
Duplicate-prefix orphansFinds plural/singular mismatches like clients_X vs client_X
02
String FK columnsDetects name-based links that should be ID-based FK constraints
03
Ambiguous name columnsFlags bare name columns that collide across joins
04
Deprecated columnsFinds *_deprecated columns left in place after migration
05
Orphan tablesTables with no FK in or out — likely abandoned or missing a link
06
Single-row satellitesTables that could be columns — one row per parent, no time axis
07
Empty staging tablesFinds *_staging and temp_* tables with zero rows
08
Casing duplicatesDetects Foo and foo both existing in the same schema
09
Broken viewsViews that reference columns or tables that no longer exist
Installation

Get started in 30 seconds

Install globally via npm, connect to your database, and generate your first audit.

Install
# install globally
$ npm install -g @arc-web/arc-tables

# or run without installing
$ npx @arc-web/arc-tables --help
Quick start
# connect to Supabase
$ arc-tables connect supabase --project your-project-ref --as mydb

# generate the full schema map
$ arc-tables map --profile mydb --output schema.html

# run the audit (card view)
$ arc-tables audit --profile mydb --format cards --output audit.html
✔ Open audit.html in your browser. Review issues, accept fixes, run fixes.sql.