> For the complete documentation index, see [llms.txt](https://docs.riff.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.riff.ai/archive/features-legacy-databutton-web-app-builder/native-database.md).

# Native Database

### What you get

* **Built-in Postgres** for your app (serverless, production-grade).
* **Agent-assisted schema & migrations** - describe the data you need; the agent can design tables and write migrations.
* **Users & Data** viewer to inspect tables and rows directly in the UI.

### Typical tasks

* **Create tables fast:** tell the agent, e.g. “Add `customers` {name, email, phone} and `orders` {total, status, customer\_id} with FK.” It will propose a schema and migrations.
* **Query & CRUD:** read/write in your backend; list records for dashboards; update statuses; delete test data.
* **Peek & debug:** open **Users & Data** to sanity-check what your app is persisting.

### How to use (quick)

1. Open **Users & Data** to see current tables.
2. Ask the agent to add/adjust schema (it generates migrations), then run.
3. Wire backend endpoints to read/write your tables.
4. Verify in **Users & Data** and your app UI.

### Good patterns

* Keep writes **server-side**; the backend owns DB access.
* Evolve with **small, reversible migrations**; commit messages should say what changed and why.
* Log identifiers, not PII, when debugging.

### FAQ

<details>

<summary><strong>Is the DB really included by default?</strong></summary>

Yes - your app gets its own Postgres DB with no extra setup.

</details>

<details>

<summary><strong>Can the agent handle migrations for me?</strong></summary>

Yes - it can design schema and write raw SQL migration files you can apply

</details>

<details>

<summary><strong>Can I view data without external tools?</strong></summary>

Yes - use **Users & Data** to browse and edit records.

</details>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.riff.ai/archive/features-legacy-databutton-web-app-builder/native-database.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
