u/Thin-Chef-532

▲ 2 r/AppBuilding+1 crossposts

Lost 3 hours to schema drift on my Supabase project — built a tool, looking for testers

Hey r/AppBuilding

Real story, posting because it might save someone else a morning.

Solo on this project. Shipped a feature to staging last week, all green. Pushed to prod the next morning, broken. Turns out I'd added an RLS policy directly in the staging dashboard a week before, "just to test something," and never wrote it into my migration files. Local fine, prod fine, staging silently drifted. Three hours of "but it worked yesterday" before I found my own mess.

Third time this year I've done some version of this to myself. I asked around. Other solo Supabase devs keep running into two close relatives of the same problem:

  • "When did this function change? Was it me? Cursor? The AI assistant in the dashboard?" Migration files only show the last create or replace from three months ago, so the body of the function has no audit trail.
  • "What does the orders table actually look like right now?" Repo has 47 migrations mutating it. To know the current shape you basically have to mentally replay every one of them in order, and nothing in the repo just shows you the truth.

Root cause is the same thing every time. Supabase migrations record changes, not current state. That's fine when I'm disciplined. Real life is me clicking around the dashboard at 2am, asking the AI to "fix this function," and forgetting to commit. The change lands in the DB. It never lands in the repo. Past me keeps sabotaging future me.

So I built SchemaLens for it. It's declarative.

  • schemalens pull introspects a live DB and writes every object (tables, views, functions, triggers, RLS, indexes, enums, extensions) to plain SQL files. One file per object. That's your current state.
  • schemalens status shows drift between repo and any environment.
  • schemalens diff dev prod compares two environments directly.
  • schemalens deploy is dry-run by default, transactional, with a --block-destructive flag for CI.
  • Dashboard side: every pull auto-snapshots, and per-object history shows when functions or policies actually changed with Pro Version.

Runs alongside Supabase migrations. Not trying to replace them.

If any of those three pains sound familiar and you're on a real project, I'd love testers. Free tier covers everything you need for testing. I'm mostly hunting introspector bugs right now, especially around custom schemas, heavy RLS, pgvector, and any setup that's a bit weird. CLI feedback also welcome.

Comment or DM. And if you already solve this with something else, please tell me what. Half the reason I'm posting is to find out I built something that already exists.

reddit.com
u/Thin-Chef-532 — 6 days ago
▲ 2 r/AppBuilding+1 crossposts

Git for your database schema.

We built SchemaLens — Git for your database schema.

It tracks every table, view, function, trigger, policy, index, enum, and extension in PostgreSQL as plain SQL files. Looking for early access testers.

reddit.com
u/Thin-Chef-532 — 12 days ago