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.

On this page

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

  1. Publish the app, then open Runtime › Data and find Production database.
  2. Select Move to Postgres and choose My own Postgres.
  3. 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.
  4. Paste that user's connection string, with your database's host (in Supabase, under Connect), and select Test connection.
  5. 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

FreeProTeamEnterprise
Own Postgres—YesYesAs your organisation allows
RuleValue
DatabasePostgres 14 or newer
Database userOne made for the app; superusers and users that can create roles or bypass row security are refused
Switch backWithin 14 days
WhoPeople 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.

On this page