Database
Overview
Managed Turso databases for your Buildspace apps.
Every Buildspace app gets a managed Turso (libSQL) database — one per environment. Databases are provisioned automatically when you create an app and connection credentials are injected into your deployed service as environment variables.
How it works
- Provisioning — When you create an app in Creator Studio, a Turso database is created for each environment (development and production).
- Credentials — Two env vars are injected into your Railway service automatically:
BUILDSPACE_DB_URL— libSQL connection URLBUILDSPACE_DB_TOKEN— auth token (JWT)
- Connection — Your app connects directly to Turso using
@libsql/client. No SDK wrapper needed — you own the connection and schema entirely. - Monitoring — Usage stats (rows read, rows written, storage) are synced hourly and visible in the Data tab of Creator Studio.
Architecture
Each app + environment pair gets its own isolated Turso database. There is no shared schema between apps — you define and migrate your own tables.
| Concept | Detail |
|---|---|
| Database engine | Turso (libSQL, SQLite-compatible) |
| Isolation | One database per app per environment |
| Environments | dev and prod (separate databases, separate tokens) |
| ORM | Drizzle ORM recommended, any libSQL-compatible client works |
| Schema ownership | You define and manage your own tables and migrations |
| Credentials | Injected as BUILDSPACE_DB_URL and BUILDSPACE_DB_TOKEN |