> 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/workspace-features/database-and-users.md).

# Database & Users

Every Riff app includes a [built-in PostgreSQL database](/archive/features-legacy-databutton-web-app-builder/native-database.md) for persistent data storage, plus integrated [user management via Stack Auth](/archive/features-legacy-databutton-web-app-builder/native-authentication.md).

Click + More and select the Database tab in the workspace top bar.

Key features:

* PostgreSQL database: Full-featured relational database
* Separate environments: Independent databases for development and production
* Migrations: Version-controlled database schema changes
* SQL queries: Run queries directly from the interface
* Schema exploration: Browse tables, columns, and relationships
* User management: Built-in authentication and user tables

How to use:

1. Ask the agent to create database tables for your data needs
2. The agent creates migrations to define the schema
3. Query data using SQL or integrate via Python APIs
4. Migrations automatically apply to production on deployment

Tips:

* Use migrations for all schema changes - they're version controlled
* Development and production databases are separate - test first in dev
* User authentication is pre-configured with Stack Auth
* The file system is not persistent - always use the database for data storage


---

# 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/workspace-features/database-and-users.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.
