Your database
The Postgres database built into your Floot project: how you reach it, when it sleeps, choosing its size and sleep time, how connections work, and how export, import, backups and restores work.
A Floot project comes with its own managed Postgres database. Your assistant sets it up the first time the app needs to store something, and there is nothing to install, and nothing to size unless you want to. This page covers how you reach it, why it sleeps, how to choose its size and sleep time, how connections work, and how to get data out, back in, or back to an earlier moment.
What you get
- A Postgres database for the project, hosted by Neon on AWS in the US East region (
us-east-1). New databases are created on Postgres 18. - Ordinary Postgres. Tables, indexes, constraints, views, functions and triggers behave the way they do anywhere, and your assistant creates and changes them with SQL.
- Compute that follows the load. It scales up by itself when your app is busy and down to zero when nothing is querying it (see below). On a paid plan you can choose the size range and the sleep time.
- One database for the preview and the published app. Anything you add, change or delete while testing in the preview is real data in the live app. For a separate copy to test against, see Duplicate a project.
How you reach it
- Your app
- Your app's backend endpoints query the database directly. A visitor's browser never talks to it.
- The Data tab
- On floot.com, open the Services tab and click Data. Pick a table to browse it, search its rows, add or edit rows and save, or delete the rows you select. The cog icon in the table header opens Database Settings, where compute, backup, export and import are; a database with no tables yet shows a Database Settings button instead.
- The database's name
- The Data tab lists each database by name. A database Floot creates is named after the project at that moment ("Floot Database for …") and keeps that name when you rename the project. To change it, point at the database in the Data tab and click the pencil icon beside the delete button (on a touch screen both are always shown), type the new name and click Rename. The owner and collaborators with edit access can do this. Only the label changes: the data, the connection settings and the environment variables your app reads stay as they are.
- Your assistant
query_databasereads,execute_sqlwrites and changes the schema, andpull_database_schemaregenerates the typed helpers your code uses — see What your AI can do.- Other tools
- To work with the data somewhere else, download an export (below) and load it there.
It sleeps when nothing is using it
A Floot database scales to zero. After about one minute without a query (about five minutes for projects created before 29 September 2026) it goes to sleep: database compute stops being billed, and your data stays exactly as it was. The next query wakes it. On a paid plan you can make it stay awake longer, or never sleep (below).
Waking usually adds a fraction of a second to that first request, and occasionally a few seconds. Your app doesn't have to handle it: the database client Floot gives your backend waits for the database and retries the connection by itself, so a wake-up shows as one slower request, not as an error.
Anything that queries the database keeps it awake: your app's traffic, a page that polls an endpoint every few seconds, scheduled jobs that read the database, browsing the Data tab, and queries your assistant runs. A job that runs every few minutes can keep the database awake around the clock, and awake time is what database compute is billed for. For a frequent job, Services → Schedules shows an estimate of what that costs — see Scheduled jobs and background tasks. If Plan & usage → Hosting shows steady database charges on an app nobody is using, ask your assistant to find what keeps querying it.
Choose its size and sleep time
Database Settings → Compute sets how small and how large the database's server may scale, and how long it stays awake when nothing uses it. Most apps never need to change them.
- Smallest size and largest size
- From 0.25 to 8 CU, each shown with its RAM (1 CU is about 4 GB). The database scales between the two by itself with the load. A new database runs from 0.25 to 4 CU. Raise the largest size for an app that is slow under heavy load; raise the smallest size to keep the database fast from the first query after a quiet spell, at the cost of paying for that size whenever it is awake.
- Sleep when idle
- After 1 minute, 5 minutes, 15 minutes, 1 hour, 6 hours or 1 day without a query, or Never (always awake). A longer time means fewer slower first requests, and more hours billed.
- Open Services → Data, open a table and click the cog icon to open Database Settings.
- Under Compute, pick the sizes and the sleep time. Below them, the section shows what a day awake costs at the smallest and at the largest size.
- Click Save.
- What it costs. Database compute is billed for the hours the database is awake, by its size at the time; asleep, it costs nothing. Never (always awake) bills every hour of the day, even with no traffic, at least the smallest size's daily cost.
- Changing the size range restarts the database. Open connections drop for a moment; Floot's database client reconnects by itself. Changing only the sleep time doesn't restart it.
- A shared database changes for every project on it. If you duplicated a project and chose to share its database, the section lists the other projects, and a change applies to them too.
- Your assistant can do the same. It reads and changes these settings through the file
static/__dev/database.json(minComputeUnits,maxComputeUnits,sleepAfterIdleSeconds, which also takes any whole number of seconds from 60 up to a week, or"never"). A change there applies at once, without publishing, under the same rules as the screen. It is told to ask you before raising them, because you pay for it.
Who can change it
- Anyone who can see the project's data can see the settings. Changing them needs edit access, and the project's owner on a paid plan; on the free plan the section offers an upgrade.
- A branch's database uses the branch defaults; change the compute on the main project.
- Some older databases, created before each project had its own database server, show the reason instead of the settings and can't be changed.
- A database shared with a project of another account can be seen here but not changed.
- While the daily hosting limit has paused your published apps, a database set to stay awake longer than 5 minutes, or never to sleep, sleeps after a minute without queries instead, and changes are refused until the pause ends. Your own setting comes back when the apps do. See Daily hosting limit.
Connections
Your backend connects straight to the database; there is no connection pooler in between. Floot's database client opens connections when a request needs them, closes them when the request ends, and retries by itself when the database was asleep or a connection dropped. Your assistant sets this up when it adds the database, and there is nothing for you to configure.
Because the backend is serverless, every request that is running holds its own connections, so a burst of traffic is also a burst of connections. Keep transactions short, and don't hold one open while waiting on something slow such as an AI call or another service.
A restricted login for your app
By default your app connects as the database's owner role, which can read, write and change everything, and row-level security doesn't apply to it. Database Settings → App login makes the app connect as a role of its own instead, floot_app_runtime, while the Data tab and your assistant's SQL tools keep the owner. The app's FLOOT_DATABASE_URL then holds only that role's password, never the owner's.
- What the app can do
- Read, add, change and delete rows in every table, including tables created later with your assistant's SQL tools, a branch merge or an import. It can't create, change or drop tables (schema changes go through
execute_sql), empty a table withTRUNCATE, or skip row-level security. - Row-level security
- Policies apply to the app, because it doesn't own the tables. In each transaction, set who the request is for and let the policy read it:
SET LOCAL app.tenant_id = '…', thenUSING (tenant_id = current_setting('app.tenant_id', true)::uuid). A table with row-level security on and no policy shows the app no rows. Views run as their owner unless they are createdWITH (security_invoker = true). - Narrowing it further
- Take rights away with SQL as usual, for example
REVOKE UPDATE, DELETE ON consent_log FROM floot_app_runtimefor an append-only table. Floot never gives them back. Don't make the role the owner of a table or a member of the owner role: an owner skips row-level security. - A login for Floot Agents
- An app with Floot Agents also gets a second role,
floot_app_agent, inFLOOT_DATABASE_AGENT_URL. It has the same rights to rows asfloot_app_runtime, and it can also create tables of its own, such as theuc_tables of collections, and change or drop the tables it made. It can't change or drop your app's tables, and row-level security applies to it on tables it didn't create. It can create only tables, indexes and sequences, never functions, triggers or views, and its tables' defaults and checks may use only built-in functions that don't run queries, read tables or change settings (now() + interval '7 days',gen_random_uuid()orformat()are fine;query_to_xml()orset_config()aren't). Two event triggers,floot_app_agent_ddl_guardandfloot_app_agent_ddl_check, refuse the rest, so nothing it makes can run code as you when the Data tab or your assistant writes to its tables. Floot keeps them in a schema of their own,floot_guard, and leaves them out of exports and duplicates. Your app can read and write the rows of the agent's tables, and the Data tab, export and merges work on them as on any other table.FLOOT_DATABASE_AGENT_URLis only set while the app login is on, and only for an app whose backend code uses it, so the Floot Agents code falls back toFLOOT_DATABASE_URLwithout it. Let the in-app agent create tables, the second switch under App login, is on by default; turned off, the agent connects asfloot_app_runtimelike the rest of the app and can't add tables or collections. To keep an agent from changing any rows, give it read-only database access in its code. - Floot Agents apps made earlier
- Their two database pools, in
helpers/agentSqlandhelpers/agentSqlExecutor, still readFLOOT_DATABASE_URL, so their collections need the owner login until you ask your assistant to change both toprocess.env.FLOOT_DATABASE_AGENT_URL || process.env.FLOOT_DATABASE_URL.uc_tables the owner created before that stay the owner's: the agent can read and write their rows but can't change or drop them. To hand one over, runALTER TABLE … OWNER TO floot_app_agentonce withexecute_sql. - When it takes effect
- The preview switches the next time it calls its backend. The published app switches at your next publish; until then the section says it still uses the owner. Turning the setting off works the same way.
- Changing its password
- Change password under the switch gives
floot_app_runtimea new password at once, and the old one stops working; the role's grants and your revokes stay as they are. No publish is needed: the published app gets the new password in the code it already runs, so nothing you are working on goes live, and for a few seconds while it switches it can't open new database connections (the ones it has open stay). The preview takes it the next time it calls its backend. If the published app couldn't be switched, the section says so and the next publish fixes it. Don't change the password with SQL: Floot doesn't know the new one, so the app can't connect, and the next publish sets Floot's again. A branch has a password of its own, changed on the branch. It changes the password offloot_app_agenttoo, in the same way. - Who can change it
- The project's owner (for a team project, a team admin); everyone else on the project sees which login the app uses. It is there for every Floot database on every plan, except a database made before databases had their own project: move that one with export and import into a new database first. A new branch starts with what main had when it was made, with a password of its own on the branch's database, and the owner can turn it on or off for that branch alone; merging a branch doesn't carry the setting to main. A duplicate starts on the owner login.
- Turning it off and on again
- Turning it off leaves
floot_app_runtimein the database as it is, with its grants and its password, and the published app keeps using it until you publish. Turning it on again reuses that role and password: the grants, your own revokes and your row-level security policies stay as they were, tables created in between are covered, and Floot sets the role's login and password again and takes awayBYPASSRLS,CREATEDBorCREATEROLEif they were given to it. Each publish with it on does the same. If the role is gone, for example after a restore to before it was made, Floot makes it again with the full grants.
Code that creates tables while the app runs stops working with it on: ask your assistant to create them once with execute_sql instead. Floot Agents collections create their tables with the agent login above. The Google and Microsoft integrations keep their sign-ins in an oauth_access_token table they create on first use: if the app login was on before that, the integration fails with an error that gives the CREATE TABLE to run once with execute_sql. On a database made on Postgres 14, the app can still create tables of its own in the public schema. A Self-edit token connected to the project acts as you, so an app holding one can still run SQL as the owner through it.
Freeze writes
Database Settings → Freeze writes makes the whole database read-only until you unfreeze it. Use it when you move the database somewhere else: freeze writes, export the database, load it on your side and switch your app over. Nothing can change after the freeze, so the export holds every change. Reads and Export keep working, nothing is published, and no password changes.
- What it stops
- Every write, from your preview and your published app, their schedules and queued tasks, the Data tab, your assistant's SQL tools, imports and merges. A write fails with
cannot execute INSERT in a read-only transaction, so sign-ups, orders and anything else that saves something get an error while it is on. - When it takes effect
- At once. Transactions already running get up to 20 seconds to finish; after that their connections are closed and what they had not committed is rolled back. Other open connections are closed too, so nothing keeps writing.
- What it does not stop
- Uploaded files in Floot Storage, and code that switches its own transaction back to read-write (
SET default_transaction_read_only = off,BEGIN READ WRITE). Schedules and queued tasks still run; their writes fail. Floot doesn't hold or replay incoming webhooks: an endpoint that saves something answers with an error, and the sender retries later (Stripe, for example, retries for up to 3 days, and its dashboard can resend an event), so the retries reach wherever the endpoint points by then. - Lifting it
- Unfreeze writes turns writes back on at once, without a publish. Connections opened during the freeze are closed so they reconnect with writes on.
- Who can change it
- The project's owner, on the main project or on a branch for that branch's own database. Your assistant can't freeze or unfreeze it. A new branch made from a frozen database starts unfrozen. A restore brings back the freeze as it was at that moment: frozen if you restore to a time during the freeze, unfrozen if before it.
Export and import
On any plan you can download the whole database as a gzipped pg_dump file (.sql.gz): Services → Data, open a table, then the cog icon → Export → Download Database (tick Structure only for the schema without any rows). On a paid plan, Import in the same dialog loads a SQL dump and replaces the whole database. The steps, file formats and limits are in Code, data, and exports.
Backups and restores
Floot keeps a continuous recovery history of your database that covers the last 7 days. On a paid plan you can put the database back to any moment in it from Database Settings (the cog icon in the Data tab), and undo that restore if it wasn't what you wanted.
Restoring the database
- Open Services → Data, open a table and click the cog icon to open Database Settings.
- Under Backups & restore, in Go back to an earlier time, pick the date and time. The page says how far back you can go.
- Click Restore, type
restore, and click Restore in the confirmation.
Restore is on paid plans, judged on the project owner's plan, and the owner and collaborators with edit access can use it. While it runs, your app may lose its database connection for a few seconds.
What a restore does
- It puts the whole database back to the moment you chose: every table, structure and data.
- Everything written after that moment is gone, including rows your users added in between. One table, or a few rows, can't be restored separately.
- Your code, your uploaded files and your stored keys are not touched. Neither are payments or emails your app already sent.
- If you duplicated the project and chose to share its database, the copy uses the same database, so it goes back too.
Undoing a restore
- Right before a restore, Floot keeps a copy of the database as it was. Database Settings then shows Restored to … with two buttons.
- Undo restore (type
undo) puts the database back to how it was right before the restore. Anything written since the restore is lost. - Keep this version (type
delete) deletes that copy. After that, the restore can't be undone. - The copy is kept for 7 days and deleted by itself after that. Until then it is billed like the rest of your database.
- Only the last restore can be undone: restoring again replaces the copy from the restore before.
When restore isn't shown
- On the free plan, Database Settings offers an upgrade instead. A copy kept from a restore made on a paid plan can still be undone or kept after a downgrade.
- Some older databases, created before restore was available, show 7-day backup enabled instead. On a paid plan, contact support with the project's link and the date and time you want to go back to, including your time zone. It has to be a moment inside the last 7 days, so write in soon after you notice a problem.
Before a risky change
Before a large migration, a bulk delete or an import, note the time and download an export. Checkpoints roll back your code and project settings, not your data.
What the recovery history does not include
- Uploaded files. Files in Floot Storage are not backed up and have no version history. Keep your own copy of any file you can't afford to lose: Services → Storage downloads them one at a time.
- Anything older than 7 days. For a copy to keep longer, download an export and store the file yourself.
The history counts as database storage: you are billed for your current data plus the last 7 days of changes, so a database that is rewritten often is billed for more than its size — see Hosting.
Using your own database instead
Floot also works with a Postgres database you host somewhere else. Ask your assistant to connect it: it hands you a secure link where you paste the connection string, so the credentials never pass through the chat. The Data tab and your assistant's SQL tools work with it the same way. Its hosting, backups and region are then your provider's, and Import in Database Settings works with the built-in database only.
To move existing data across, export the Floot database and load the file into yours — Self-hosting has the command.
When hosting is taken down
If your hosting balance stays unpaid and your apps are taken down, the database is disabled along with them: it can't be opened, queried or exported until the balance is paid. The data is kept, and the database comes back with the same data once the balance is positive again — see Reliability and limits.