> ## Documentation Index
> Fetch the complete documentation index at: https://docs.helloleo.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Database

> Store your app's own data, in Preview and in Published

Your app gets its own database. Ask Leo for the data you need and it creates the tables.

> [!NOTE]
>
> Available on **Leo Business** and above.

## Create tables

Describe the data in plain words:

```
Add a table to store quote requests: company, contact email,
product, quantity, status, created date.
```

Use the database for data that belongs to the app itself: form submissions, drafts, approval states, anything that has no business living in your ERP.

## Preview and Published

Your app has two separate databases:

* **Preview**: the one your preview uses while you build.
* **Published**: the one your live app uses.

They never share data. You can try changes in Preview, add test rows or remove them, and nothing reaches your published app or its users.

## How changes are applied

When Leo changes the shape of your data (a new table, a new column), it writes the change as a migration.

* **In Preview**, the migration is applied automatically once Leo finishes his turn.
* **In Published**, the migration is applied when you [publish](https://docs.helloleo.dev/features/publishing.md) your app. If the migration fails, the publish fails and your live app stays as it was.

## Browse your data

Open the **Database** section of your project to see the tables and their rows. Use the switch at the top to pick **Preview** or **Published**. The Published database exists once you have published your app.

Browsing is read-only. To change data, use your app or ask Leo. From a row's menu, **Copy row as JSON** copies it.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.