Stop migrating. Your Postgres is already the backend
How to put a new, multi-role app on the database you already run, without a second copy or a migration plan. Then a 10-minute experiment to see whether you can break it. Every "let's rebuild it" project has the same s
How to put a new, multi-role app on the database you already run, without a second copy or a migration plan. Then a 10-minute experiment to see whether you can break it.
Every "let's rebuild it" project has the same slide. Phase 1: migrate the data.
It always looks small on the slide. Then you meet the booking system that has written to that Postgres every day for six years. The nightly finance job that reads three of its tables. The POS terminals that will never write through your new API. Phase 1 becomes the whole project, and the new app ships two quarters late, if at all.
AI app builders tend to make this worse. They're good at greenfield. Ask Replit's Agent for persistence and it sets up a PostgreSQL database and creates the schema for you. That's ideal for a new idea. If you already have a database, the first thing the AI does is create the migration you were trying to avoid.
I'm a co-founder of Supero, and this is the problem we built it around. The question:
Can a brand-new app, with its own users and roles, run on the tables you already have, and leave them where they are?
Yes. The connection string is the easy part.
The 30-second version
- Pick a mode per table, not per database. Copy the slow reference tables, read the busy ones live, and write through only where the new app owns the data.
- Every request carries its own rules. The caller's tenant and the columns their role may use are compiled into the SQL before it reaches your database.
- Your app code doesn't care. A live table answers the same API call as a native one.
Analysts got this years ago. Apps didn't.
Querying data where it lives is a solved problem if you're the one writing SQL:
-
Supabase Wrappers turn Stripe, ClickHouse, BigQuery or S3 into Postgres tables you can
SELECTfrom, with no ETL in between. - Databricks Lakehouse Federation, announced in 2023, lets you discover, query and govern MySQL, PostgreSQL, Snowflake and others without moving or copying the data first.
- Snowflake Secure Data Sharing gives a consumer live access, and no data is copied or moved between accounts.
All three are excellent, and they assume the caller is someone with credentials who writes SQL.
Now meet the person your app serves. Priya is a dispatcher. She opens the orders screen on her phone between two calls. She has no database role. She should see her company's orders and nobody else's. She can see status and total, but internal_margin is for managers only. The app writes the SQL on her behalf, thousands of times a day.
If every user of your app maps to a database role, Postgres column GRANTs and row-level security already handle this well. Priya doesn't, and neither do most app users. So the rules have to travel with her request.
Which tool for which job
These products overlap less than they seem. Each is the best fit for a different job:
| Job | Supabase | Replit | Databricks | Snowflake | Supero |
|---|---|---|---|---|---|
| New app, new database, fastest start | Strong fit | Strong fit | Possible, inside a workspace | Possible, inside an account | Good fit: one prompt to a preview |
| Analysts querying data across systems | Not the goal | Not the goal | Strong fit | Strong fit | Not the goal |
| App for your own users on a database you already run, rules on every request | Possible, you build it | Possible, you build it | Not the goal: app viewers must be account users | Not the goal: external viewers share one role | Built for this |
| One shared database serving many customer orgs | You write RLS per table | You write it in app code | Row policies, for platform users | Row policies, for platform users | Built in: tenant binding, deny by default (Pro) |
| Hidden columns that also can't be sorted, filtered or grouped by | Per database role | You build it | Column masks, for platform users | Masks apply in queries, for platform users | Built in, per app role |
Sources, checked 20 November 2026: Supabase column-level security, Supabase postgres_fdw, Replit authentication, Databricks app permissions, Databricks query federation, Snowflake external-viewer embedding, Snowflake column security.
Snowflake and Databricks enforce strong column and row rules, for people who have an identity in their platform. The gap Supero fills is the same rules for app users who don't, on a database that lives outside those platforms. And where they're ahead, they're well ahead: Supabase is open source with SOC 2 and HIPAA, Replit is the fastest route to a brand-new app, and Databricks and Snowflake are built for analytics at a scale Supero doesn't attempt.
If you're building an app for your own users on data you already run, that's the job Supero is built for.
One database, three decisions
The choice isn't "connect our database or don't." It's three questions, asked once per table:
| Mode | Reads come from | Writes go to | Use it for |
|---|---|---|---|
sync |
A copy in the platform | The copy, never your database | Reference data you'd rather keep a copy of |
live_read |
Your database, every request | Refused with 403
|
Tables another system owns, like orders from the POS |
live_readwrite |
Your database, every request | Your database, in the same request | Tables the new app owns (PostgreSQL, Supabase, MySQL) |
One connector can mix all three. The connector config, trimmed:
{
"source": { "plugin": "database",
"config": { "db_type": "postgresql", "host": "db.internal.example",
"database": "operations", "username": "supero_connector",
"table_names": ["customers", "orders"], "ssl_mode": "require" } },
"target": { "tables": [
{ "source": "customers", "schema": "customer_mirror", "mode": "sync" },
{ "source": "orders", "schema": "order_live", "mode": "live_read",
"live": { "primary_key": ["order_id"],
"columns": [ { "name": "order_id", "sql_type": "integer" },
{ "name": "status", "sql_type": "varchar" },
{ "name": "total", "sql_type": "numeric" },
{ "name": "internal_margin", "sql_type": "numeric" } ],
"field_map": { "order_id": "order_id", "status": "status",
"total": "total", "internal_margin": "internal_margin" },
"tenant_binding": { "mode": "fixed", "tenant": "acme-ops" } } }
] }
}
columns matters: it is the allow-list of column names the planner will accept. If you'd rather not write it by hand, let discovery build the live block and then set only the tenant binding.
internal_margin is hidden from Priya by her role, not by the connector. Add it to the staff role's hidden_fields in its access rule, and managers still see it.
Your app reads order_live with the same endpoint and SDK as any other table:
import supero
org = supero.connect(domain_name="acme", api_key="ak_...", project="order-desk")
orders = org.crud.list("order_live", limit=20) # rows come from your Postgres
A fixed binding is only for a table that holds one tenant's rows. If the table has an org_id-style column, Supero refuses the fixed binding unless you confirm the table holds one tenant's data. For one Postgres shared by many customer orgs, use a column binding, and every query gets a tenant predicate:
"tenant_binding": {
"mode": "column", "tenant_field": "org_id",
"tenant_value_map": { "acme": "42", "globex": "77" },
"on_unmapped_tenant": "deny"
}
deny is the default. A tenant someone forgot to map gets a 403, never the whole table. (Apps with many tenants are on the Pro plan and above.)
The trip one request takes
Priya taps "Orders." Seven steps later she sees 20 rows. Three of them are where a homegrown pushdown usually leaks:
Scope the tenant. Her tenant becomes WHERE org_id = $1, with 42 bound as a parameter, never pasted into the string.
Guard the fields on the way in. Hiding internal_margin from the response is the easy half. If Priya could still filter on it or sort by it, she could binary-search every margin in the company without seeing one. So a field her role hides is refused as a filter, a sort key, an aggregate or a group-by, with a 400, before any SQL exists. For role-hidden fields the error is deliberately generic, because "that column is hidden" is itself a leak.
Compile from a closed list. Every column name is checked against that table's column list, then quoted. Every value is a bound parameter. One live query reads at most 10,000 rows by default, and when it hits the cap the response says so (source_meta.scan: "partial").
On a read, your database only ever receives a SELECT that was already safe to run. Supero also sets a 30-second statement_timeout on its own sessions and tags them application_name=supero-live-read/<connector id>, so your DBA can find them in pg_stat_activity.
Writes, when the app owns the table
live_readwrite sends inserts, updates and deletes to your database in the same request. A few rules hold it together:
-
The tenant column is set by Supero on insert and added to the
WHEREon update and delete. A caller who tries to set it gets403. -
Primary keys can't be changed, and an update or delete that matches no row in the caller's tenant returns
404. - Each table needs a stable primary key. Tables with no key, or a timestamp in the key, are treated as event streams and stay read-only.
-
Engines: PostgreSQL (Supabase included) and MySQL accept live writes; Postgres is the one verified end to end. SQL Server reads live but refuses live writes with
501.
The 10-minute experiment
Reading about a guard is nice. Trying to beat it is better. You can start without a card, and connecting your AI needs no API key. Role and field rules are listed from the Pro plan up on the pricing page, so check your plan first.
1. Connect your AI. In a terminal, for Claude Code:
claude mcp add --transport http --scope user supero "https://mcp.supero.dev/mcp?features=core"
On claude.ai or ChatGPT, add https://mcp.supero.dev/mcp as a custom connector instead. You sign in through your browser.
2. Paste one prompt.
Build an order desk with Supero. Orders have order_id, customer, status,
total and internal_margin. Two roles: managers see internal_margin, staff
never do. Seed 30 realistic orders. Run build_verify, deploy a preview,
and give me the URL plus one manager and one staff login.
Previews last 30 minutes.
3. Try to break it. Sign in as staff and go hunting for the margin:
- Filter on it with a range. Does the row count change?
- Sort by it, ascending then descending. Are the two lists mirrors?
- Ask for a count grouped by it.
If any of those tells you something about a column you can't see, that's a real bug, and I want to hear about it. A 400 every time means the guard is doing its job.
4. Point it at the real thing. Bringing your own database starts at the Basic plan. Create a connector with a least-privilege role and bind your orders table to the same object type in live_read. The app code doesn't change, as long as the field names match. A few query features, such as keyword search and range filters, return 501 on live tables, because they can't be pushed down faithfully yet.
CREATE ROLE supero_connector LOGIN PASSWORD '...';
GRANT USAGE ON SCHEMA public TO supero_connector;
GRANT SELECT ON public.orders, public.customers TO supero_connector;
-- only for tables the app writes through:
-- GRANT INSERT, UPDATE, DELETE ON public.support_notes TO supero_connector;
Know this before you point it at production
-
Check the stamp, not the status. A live response carries a top-level
access_modeoflive-ro,live-rworwarehouse. If the platform can't resolve the connector binding for a caller, the read falls back to the empty local store and returns200with no rows. Monitor the stamp. - What Supero keeps. No row data for live tables, except the sample rows discovery reads to map columns and, for read-write tables, each row's primary key so records stay addressable.
-
Column tenant binding is set over the API. The console wizard saves a fixed binding and an empty hidden-fields list, so
PUTboth and read them back. -
No conflict referee. With
live_readwrite, both your app and the POS can change the same row. Supero doesn't arbitrate; reconciliation is yours. That's whyordersstayslive_readhere. - Direct connections skip the rules. A BI tool logged straight into Postgres sees everything its own role allows. Supabase row-level security doesn't apply to the connector's login either, so scope that role tightly.
- Engines differ. Warehouses (Snowflake, Databricks, BigQuery, Redshift, ClickHouse, Fabric) are live and read-only, with results held in memory for up to 60 seconds. Oracle and MongoDB are sync-only for now, so ask us first.
When to copy instead
Live reads trade features for custody. Use sync for a table when you need keyword search, range filters, multi-field sorts or raw aggregation pipelines on it, or heavy queries you'd rather not run on your production primary. Simple stats, counts and distinct values still run in your database on live tables. Everything else can stay home.
The migration slide doesn't have to be Phase 1. For most tables it doesn't need to exist at all.
Try the experiment: supero.dev ยท How live reads and writes work: Connect your database ยท The security model: Live reads and writes: the security model
Originally published by Dev.to Security. Aggregated on AIWithGhost for educational purposes โ full credit and traffic to the original publisher.



