Add a SQLite database to an app
add_sqlite_databaseGives a deployed app a SQLite database that is kept and backed up: the database file lives on a volume, so it survives deploys and restarts, it is copied continuously to backup storage (restore to a point in time from the app's page), and the app is kept at one instance. Use this, not add_volume, for an app whose data is a SQLite file. db_path is the file the app opens: it must be directly in /data (a volume is created there) or on a volume the app already has. The app also gets DATABASE_URL (sqlite://) and SQLITE_DB_PATH, and restarts. A database file already on the app's own disk is not copied: the app starts with an empty database. One per app; not for a static site. The volume costs money every month: tell the user the price (detect_source and this tool's answer give it) and confirm with the user first.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"name": "<name>"
},
"name": "add_sqlite_database"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | The app's name. | |
| db_path | No | The absolute path of the database file the app opens, such as /data/app.db (the default). Read it from the app's source; if the app reads SQLITE_DB_PATH or DATABASE_URL, leave this out. | |
| size_gb | No | Size in GB of the volume created at /data (default 1, at most 100). Ignored when the file is on a volume the app already has. |