Backend and data
Your app's database
How your app saves data, how to see and edit it in Manage → Database, let the AI look at and fix it safely, run SQL, and undo mistakes.
When your app needs to remember something, such as bookings, orders, messages or each person's saved items, it keeps it in a database. Every app on Buildliy hosting gets its own private database, set up for you. There's nothing to install and no settings to choose.
This page explains how data gets in, how to see and change it, how the AI can help with your data, and how to undo a mistake.
How data gets into your database
Most of the time you just describe what your app should keep, and the AI does the rest. It creates a table for each kind of thing (for example bookings, products or members) and builds the screens that read and save them.
Add a bookings page where customers pick a class and a time. Save every booking so I can see them later.
There are a few other ways data arrives:
- People using your app. Every sign-up, order or form your app saves adds a row.
- Your existing data. Attach a CSV, JSON or Excel file (up to 5 MB) in the chat, or give a link to one, and ask the AI to load it. It creates the table and fills it in one step. One import brings in up to 5,000 rows; for Excel, the first visible sheet is used.
- By hand. Add a row yourself in Manage → Database (see below).
Here's my product list as a CSV. Put it in the database and show it on the shop page.
Sometimes the AI works out that your app needs accounts and saved data even though you didn't say so. Before it adds them, it may ask with a card called Your app needs accounts and saved data. Click Set it up to add them, Not yet to keep going with clearly labelled sample data instead, or Tell me more for an explanation.
How your database works
- It's private. Only your app's own server code can reach the database. Visitors' browsers never talk to it directly, so there's no key in your pages that someone could use to read it.
- Your preview and your live app share it. Whatever you save while testing in the preview, including test sign-ups, is in the same database your published app uses. Once your app is live, Manage → Database reminds you: "Your preview and your live app use the same data, so changes you make while testing show up for real visitors."
- It runs on your credits. A database uses credits for the time it's awake, the data it stores, its restore history and the data it sends. When nobody is using your app, it goes to sleep. Your plan includes free hosting credits each month, which are used first. See Hosting and Credits and usage.
- It pauses if you run out of credits. Your app's database pauses first, and your published pages stay online for 2 more days. Nothing is deleted. Add credits and everything starts again by itself.
Browse and change your data
Open the Database section
Open the Manage tab and choose Database. Your tables are listed on the left, each with its number of rows.
Pick a table
Click a table to see its rows, its columns, and a short note under Who can read or change rows.
Find what you need
Type in the search box above the rows to filter them. Use Prev and Next to move between pages.
From there you can:
- Change a value. Click it, type the new value, then press Enter to save or Esc to cancel. A message confirms the save, with an Undo button.
- Add a row. Click Add row and fill in the form. Required fields are marked.
- Delete rows. Tick the rows, click Delete, and confirm. They disappear from your app straight away. Before deleting, Buildliy saves a backup of all your app's data (see Backups and undo).
- Download a table. Click Download CSV to save every row as a spreadsheet file, or search first and click Download matches to save only the matching rows. Passwords, keys and other hidden values are left out. One download holds up to 20,000 rows; for a bigger table, the message tells you how many were included.
Passwords, keys and other secret-looking values are hidden and can't be edited here. Some tables are view-only, such as tables your app's sign-in system looks after, and a table without an id column can be searched and downloaded but not changed. When a table needs a value only your app can fill in, like a password, new rows have to come from your app itself. To add a new table or change a table's columns, ask the AI in chat.
To see a plain-English summary of what your app stores, open the Workspace menu at the top right and choose Data.
Let the AI look at and fix your data
You can ask the AI questions about your data, or ask it to clean up or reshape it, right in the chat.
How many bookings do we have for next week?
Delete the test sign-ups I made with my own email address.
The AI can read rows (up to 50 at a time, with email addresses and phone numbers partly hidden), add, change and delete rows, and add or rename columns. Small, safe changes happen straight away. Before it deletes rows, changes more than 20 rows in one build, or renames a column, it stops and shows a card such as "This deletes 37 bookings", with Cancel and a button to go ahead. Only the project's owner can approve it, and the AI keeps a copy of your data from just before the change for up to 24 hours.
These data tools can't remove whole tables. Because your preview and live app share one database, a change the AI makes to your data also affects your live app.
Run SQL
If you know SQL, open Manage → SQL editor to run queries against your app's database.
- Type your SQL and click Run, or press CmdEnter (Mac) or CtrlEnter (Windows).
- Statements that destroy data, such as dropping a table, emptying one, or deleting or updating rows without a condition, stop with Destructive statement — confirm before running. Click Run anyway only if you're sure. It can't be undone without a backup.
- Starter queries gives you three ready-made queries that work as they are: List my tables, Count rows in every table (exact counts) and Show RLS policies.
- Some system areas are off-limits, and the editor refuses SQL that touches them, such as
information_schemaor the database's ownpg_…tables. Use the starter queries to see your tables instead. - In new apps, everything you run at once happens as one all-or-nothing step, so maintenance commands that can't run that way, such as
VACUUM, don't work here.
The SQL editor works on the same data as your live app.
Who can see what
When your app has accounts, the AI builds it so that each thing a person saves is linked to them, and your app's server code checks who is signed in before it reads or saves it.
In new apps, the database enforces this too. Your app connects with a restricted login, and the database only shows each person their own rows, even if a page forgets to check who's signed in. You still see every row in Manage → Database and the SQL editor. The launch checklist shows Each person's data is locked by the database, or blocks publishing with Some people's data isn't locked to them if a table with people's own data isn't locked.
In apps made earlier, the check lives only in your app's code, so it relies on every page and data link doing it. The launch checklist points this out with Each person's data is kept apart by your app's code, a suggestion that doesn't stop you from publishing.
In a new app, if your app's own code adds database code of its own, such as functions, triggers, views or rules, Buildliy stops showing or changing that data in Manage → Database, Manage → Users, the SQL editor and the AI's data tools, because that code could run with full access to your database. You'll see a message starting "Your app's own code changed its database in a way Buildliy can't safely work with". Ask the AI to remove what your app added to its database, or manage that data from inside your app.
Data you want everyone to see, like a menu or a list of products, can be public. Just say so when you ask for it.
To check how this works in your app, open the Workspace menu and choose Roles for a plain-English list of each type of user and what they're allowed to do. Before you publish, a safety check also looks for pages and data links that show people's details to visitors who aren't signed in, or to every signed-in account. When it's sure it found one, you have to fix it before you can publish. See Launch checklist. For sign-in itself, see User sign-in.
Backups and undo
There are several ways to get data back:
- Undo a delete. When you delete rows in Manage → Database, a backup of all your app's data is kept for 24 hours (the 3 most recent are kept). Click Undo a delete, pick a backup, click Put back, then Put it back to confirm. Every table goes back to how it was at that moment, so anything added or changed since then, like new orders or sign-ups, is undone too. Your data as it is right now is kept for 7 days, so you can switch back.
- Manage → Backups. Lists copies of your data made before big changes: before a data rewind (kept 7 days, with Undo rewind) and before a change the AI made after you approved it (kept up to 24 hours, with Put this data back). It also lists the changes the AI made to your data.
- Restore with data. When you restore an earlier version from Build history, you can tick the data option to rewind your data as well as the code and design. It's off by default, and only the project's owner sees it, for apps whose data is on Buildliy hosting. Data history only goes back so far; for older versions only the code can be restored. See Version history.
Only the project's owner can see backups and put data back.
Your app's code, whether downloaded from the Code tab or sent to GitHub, doesn't include the data in your database. To keep your own copy of your data, download each table with Download CSV.
Using your own database
If you'd rather keep your data in your own Supabase or Neon account, you can connect it in Manage → Backend. Backups, data rewinds and some AI data tools only work on Buildliy hosting. With your own Neon project, Manage → Database lets you look at, search and download your data, but changes are made in Neon's own dashboard. With your own Supabase project, you look at and change your data in your Supabase dashboard. See Use your own backend.
Related
Still stuck? Read the FAQ or contact us.