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

# SQL

> Store workspace files in SQL tables.

SQL stores workspace files in a database's tables, laid out as
[AgentFS](https://github.com/tursodatabase/agentfs)'s. The files last as long
as the database does. A mount serves the whole database, or one folder of it,
so several mounts can share one database.

## Configuration

For Python or Node, set `path` to the SQLite file. Leave it out to keep the
database in memory:

```yaml theme={null}
mounts:
  /data:
    vfs: sql
    mode: write
    config:
      path: ./workspace.db
```

A Postgres server, a Durable Object's storage or a D1 database mounts from
code, through its driver. See the SDK guides.

Add `capacity: 100MB` under `config` to cap the bytes the database's files
hold. See [capacity](https://docs.mirage.strukto.ai/home/setup/vfs.md#mount-capacity).

Add `root: /workspace` under `config` to serve only that folder of the
database. Mirage makes the folder when it is missing. A mount of the whole
database lists the folder too, and its files count against the same database.

## SDK guides

* [Python SQL VFS](https://docs.mirage.strukto.ai/python/vfs/sql.md)
* [TypeScript SQL setup](https://docs.mirage.strukto.ai/typescript/setup/sql.md)


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