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

# Database

> Every website gets a SQLite database at the edge for storing users, content, and application data.

Every website built with Runable includes a SQLite database powered by Cloudflare. The database runs at the edge, close to your users, so reads and writes are fast regardless of location.

You do not need to set up or configure the database. It is created automatically when the agent builds your website.

## How the database works

The agent writes database code as part of your website. When your site needs to store data (user accounts, form submissions, product listings, blog posts, anything), the agent creates the tables, writes the queries, and handles migrations.

<Columns cols={2}>
  <div>
    ### What the agent handles

    * Creating tables and defining schemas
    * Writing queries for your application logic
    * Running database migrations on deploy
    * Setting up relationships between tables
  </div>

  <div>
    ### What you describe

    * What data your app needs to store
    * How users interact with that data
    * What pages or features need database access
    * Any specific data requirements
  </div>
</Columns>

## Querying from the dashboard

You can run SQL queries directly from the **Runable** dashboard for debugging or inspecting data.

<Frame caption="The database query interface in the website dashboard.">
  <img src="https://mintlify.s3.us-west-1.amazonaws.com/runableinc/images/placeholder.png" alt="Website dashboard showing a SQL query input field with results displayed in a table below" />
</Frame>

## Migrations

When you change the database schema (add tables, modify columns), the agent writes migration files. Migrations run automatically during deployment. This ensures your production database stays in sync with your code.

## What you cannot do

* You cannot connect an external database (PostgreSQL, MySQL, etc.) in place of D1. The built-in database is SQLite via Cloudflare D1.
* You cannot access the database from outside your website. It is only accessible from your website's backend code.
* You cannot download a database backup from the dashboard.
* You cannot create multiple databases for the same website. Each website gets one database.

## Next steps

<CardGroup cols={2}>
  <Card title="Storage (R2)" icon="hard-drive" href="/build-websites/ai-websites/storage">
    Learn how file storage works for your website.
  </Card>

  <Card title="Payments (Stripe)" icon="credit-card" href="/build-websites/ai-websites/payments">
    Accept payments on your website with Stripe.
  </Card>
</CardGroup>
