# How to Add and Use a Database in ChanTan Studio

> Give your app a memory in about a minute. Connect a database with one click, see the data your app saved, edit rows by hand, and ask questions in plain English.

Last updated: 2026-08-21 · https://chantan.studio/docs/en/database-tab/

Without a database, your app forgets everything the moment someone closes the page. With one, it can have real accounts, save what people type, and show the same information on any device.

**You do not have to understand databases.** The AI creates the lists and columns, writes all the saving and loading code, and turns on data protection for you.

## 1. Open "Manage ▾" → "Database"

At the top of your project, press **"Manage ▾"**, then **"Database"**.

If this project has never had a database, you get a chooser instead of data, headed **"Welcome to Database"** — *"Add a database to store user accounts, save data permanently, and build apps with login, forms, and persistent state."*

## 2. Choose "⚡ Chantan database"

Press **"Connect now →"** under **"⚡ Chantan database"**. That's the one-click option and the right answer for almost everyone.

| | **"⚡ Chantan database"** | **"🔷 Your Supabase"** |
| --- | --- | --- |
| Tagline | *"One click. No setup needed."* | *"You own the data. Full control."* |
| What you get | *"Free to start"* · *"Real Postgres — auth, storage, functions"* · *"Scales automatically as you grow"* | *"Free 500 MB on Supabase"* · *"Direct dashboard access"* · *"Data never leaves your account"* |
| Button | **"Connect now →"** | **"Paste credentials →"** |

Choose **"🔷 Your Supabase"** only if you already have a Supabase account and specifically want the data to live in it.

## 3. Wait about a minute

The closest region to you is picked automatically. You'll see **"Setting up your database…"** — *"Creating your managed database — this usually takes about a minute. The full manager opens automatically when it's ready."*

✅ **Done.** The manager opens by itself. You should now see your app's data screen instead of the chooser — and your app can save things permanently.

| What you see | What to do |
| --- | --- |
| *"Setup is taking longer than expected — it may still finish. Check back shortly."* (after 8 minutes) | Wait a few more minutes. It often finishes anyway — don't start over. |
| **"Database setup didn't finish"** — *"Something interrupted creating your managed database. Your project is fine — you can try again."* | Press **"Retry setup"**. |

## You can also just ask in the chat

Type something like *"add login"* or *"save data"* and the AI shows the same picker.

When the AI works out that a feature needs saved data, it stops **before writing any code** and shows a card in the conversation:

> **"Your app needs a database"** — *"Defaulting to Chantan DB unless you choose another option."*

The ChanTan option is marked **"Default"** with a **7-second** countdown — *"Auto-connects in {seconds}s"* — so **doing nothing is a valid answer**. The alternatives are **"Connect your own Supabase"** and **"No database — build with local state only"**. When it works you'll see *"Connected — continuing your build…"*

## Looking at your data

Once connected, **"Manage ▾"** → **"Database"** opens the **"Database"** page — *"View and manage the data stored in your app."*

You see the lists your app saves, each with a row count. Click one to open its records.

| Control | Label | What it does |
| --- | --- | --- |
| Tip line | *"Tip: click any row to edit it."* | — |
| Search | *"Search {list}…"* | Filters as you type |
| Export | **"Export CSV"** | Downloads the rows **currently on screen** as a spreadsheet file. Free and instant |
| Add | **"Add row"** | Opens a form to create one record |
| Edit | click any row | Change values, then **"Save"** |
| Delete | **"Delete this row"** | Asks **"Delete this row permanently?"** with "Yes, delete" and "Cancel" |
| Paging | *"Showing {from}–{to}"* | **100 records per page** |

If you see **"Cannot update row. This table does not have a primary key."**, that list has no unique ID column, so single records can't be changed from this screen. Ask for the change in the chat instead.

## Asking questions in plain English

The **"Query your data"** box lets you ask things like *"Show me all users who signed up in the last 7 days"*. It has three modes — **"Chat"**, **"SQL"** and **"Chart"** — and can draw a chart once you pick the two axes.

**This box can only look, never change.** Ask it to modify something and it answers **"You can't directly alter your database schema, use chat instead"**. That's the correct advice: type structural changes in the chat.

> ⚠️ **The "SQL Editor" under "Advanced" is a different thing and it is powerful.** It warns you — *"Heads up: Commands here run on your live database and can change or remove data. Double-check before you run."* — and then **runs immediately, with no second confirmation and no undo**. Most owners never need it.

## Connecting your own Supabase

Choosing **"🔷 Your Supabase"** opens a guided form headed *"3-minute setup — follow these steps"*:

1. Create a Supabase project if you don't have one.
2. Copy your **URL** and your **anon (public) key**. *"⚠ Do NOT use `service_role` — it has full admin access and should never be shared."*
3. Run the setup command it gives you, using the **"Copy Setup SQL"** button — *"This creates the data table + storage buckets your app needs. One-time, safe to re-run."*
4. Optional: an advanced box that lets the AI build server-side integrations on your own Supabase. Without it, all your data and file features still work.

Then press **"Test & Connect"**.

| Message | What to do |
| --- | --- |
| "Supabase URL and anon key are required." | Fill in both fields |
| "Supabase URL must start with https://" | Paste the full address including `https://` |
| *"That looks like a service_role key. Please use the ANON (public) key instead…"* | Copy the **anon (public)** key, never the admin one |
| "Connection failed." | Re-check both values |
| *"Too many connection tests. Please wait an hour."* | You get **10 tests per hour** |

One limit to know: while your project uses **your own** Supabase, ChanTan can't add, edit or delete the people who sign in to your app — it tells you *"Open the Auth tab in your Supabase dashboard."* Your usage is also tracked there: *"Usage is managed in your own Supabase."*

## Your data is secured for you

You don't switch it on. **"Your data is automatically secured"** — *"Chantan turns on data protection for every table when you publish — you don't need to do anything."*

The **"Suggestions"** screen offers optional extras (making public files private, blocking passwords known to be leaked, adding two-step sign-in). **None of them has a fix button** — each says to ask ChanTan in the chat, which is the right route.

## What it costs

**Included free with every project:** **0.5 GB** of database storage, **1 GB** of files and **50,000** active users a month — plus the Free plan's allowance of **10,000 rows, 1,000 users and 500 MB**.

| Plan | Rows | Active users / month | Storage |
| --- | --- | --- | --- |
| Free | 10,000 | 1,000 | 500 MB |
| Pro | 500,000 | 50,000 | 5 GB |
| Business | 5,000,000 | 500,000 | 50 GB |
| Enterprise | unlimited | unlimited | unlimited |

Beyond the free allowance the product **discloses** rates — 31.25 credits per GB of database storage per month, 5.25 credits per GB of file storage per month, 0.8125 credits per active user per month. **Charging for this metered usage is currently switched off**, so those amounts are shown but not taken today. Don't assume it stays free forever.

If a paid level can't be covered by your wallet for a day, the project quietly drops back to Free — **your data is never deleted**. You're warned first: *"Low credits. Top up to keep your database fast — your data is always safe."*

## Speed levels ("Database performance")

| Level | What it says | Cost |
| --- | --- | --- |
| **"Standard"** | *"Free. Sleeps when idle."* | **Free** |
| **"Boosted"** | *"Always-on for steady traffic."* | 83 credits/day (~2,500/month) |
| **"Turbo"** | *"Faster under heavy use."* | 125 credits/day (~3,750/month) |
| **"Performance"** | *"High-traffic apps."* | 500 credits/day (~15,000/month) |
| **"Dedicated"** | *"Maximum power. Needs admin approval."* | 917 credits/day (~27,500/month) |

**Every paid level needs a quick administrator approval**, even though only "Dedicated" says so on its card. After requesting you'll see *"Request sent. An admin will review your upgrade shortly — you'll be switched over automatically once it's approved."* Switching takes about a minute and your data stays safe throughout.

## Honest limits

- **[Undo](https://chantan.studio/docs/en/version-history-and-undo.md) restores your files and code, never your data.** Deleted records are gone. That's exactly why the AI stops and asks you to confirm in the chat before running anything that permanently deletes data — take that prompt seriously.
- **There is no self-service restore button** for database data. If you need data restored, contact support — [what is and isn't backed up](https://chantan.studio/docs/en/backups.md) spells out exactly what exists.
- **Bulk-exporting all your app data isn't a one-button feature.** "Export CSV" downloads what's on screen; for more, ask the AI in the chat to build an export inside your own app.
- **"Sign-in settings" is written in developer language and is easy to break.** Leave it alone unless the AI specifically told you to change something there — ask in the chat instead. Only a fixed list of settings can be changed from ChanTan; anything else is refused with *"One or more auth settings are not allowed."*

## If something looks wrong

| What you see | What it means |
| --- | --- |
| "No data yet" | Your app hasn't saved anything yet. Data appears as soon as someone signs up or submits a form. |
| The "Welcome to Database" screen again | This project has no database connected — pick one of the two options. |
| "Chantan Cloud isn't available for this project" pointing at a Database tab | That project is on a retired old store. Open "Manage ▾" → "Database" and connect a database — saving starts working again after that. |
