Supabase and Postgres
Keep your app's data in your own Postgres or Supabase
Move a published app's data to your own Postgres 14 or newer, such as a Supabase project, without changing the app's code.
A published app can keep its data in your own Postgres database, such as your Supabase project, instead of Ahamo's built-in database. Its code stays the same, and the app keeps running while the data moves. Ahamo uses a database user made for this app, which owns only the app's schema. Don't give it other access.
When to use it
- Your organisation requires production data in a database it runs.
- You want to use your own tools, backups or reporting on the app's data.
When you import a repository that uses Supabase, Ahamo offers to keep your Supabase database only on a plan that includes your own Postgres, and recommends moving the data to Ahamo, because with your own Postgres, the tables you already have become read-only in the app (external tables).
How to use it
- Publish the app, then open Runtime › Data and find Production database.
- Select Move to Postgres and choose My own Postgres.
- Run the SQL shown, once, in Supabase's SQL editor (or as your database's owner). It creates a user for this app that owns only the app's schema. Its password is made in your browser. Ahamo receives it only in the connection string you paste, keeps it encrypted and never shows it again.
- Paste that user's connection string, with your database's host (in Supabase, under Connect), and select Test connection.
- Choose Bring my data or Start empty, choose the data spaces, and select Move.
The card then says Moved to Postgres, with the number of rows moved. For a few seconds while it switches, saving asks people to try again.
You can Switch back to Ahamo's built-in database for 14 days, choosing whether to keep or delete the app's tables in your database.
Plans and limits
| Free | Pro | Team | Enterprise | |
|---|---|---|---|---|
| Own Postgres | — | Yes | Yes | As your organisation allows |
| Rule | Value |
|---|---|
| Database | Postgres 14 or newer |
| Database user | One made for the app; superusers and users that can create roles or bypass row security are refused |
| Switch back | Within 14 days |
| Who | People who can publish the app |
An organisation can allow own databases, require them for production, or turn them off.
Troubleshooting
"That user can reach far beyond this App." You pasted the postgres user or another powerful one. Run the SQL
shown and use the user it creates.
"Moving to your own Postgres, such as Supabase, is included from Pro." Upgrade the workspace to Pro.
"The move to Postgres did not finish." The app kept running on its previous database. Read the reason, fix it and move again.