Skip to main content

Database Providers

Radarboard supports 4 database providers for storing settings (widget layout, project order) and API cache.

Supported providers

ProviderTypeSetupBest for
SQLiteLocal fileZero config (default)Local development, single machine
SupabaseCloud PostgreSQLURL + anon keyCloud hosting, Supabase users
TursoEdge SQLiteURL + auth tokenEdge deployments, low latency
PlanetScaleCloud MySQLHost + username + passwordMySQL-based infrastructure

Configuration

Via environment variable

.env.local
DATABASE_PROVIDER=sqlite  # or supabase, turso, planetscale

Via .radarboard.json

The database provider can also be configured through the Settings UI, which writes to .radarboard.json:
.radarboard.json
{
  "database": {
    "provider": "turso",
    "config": {
      "url": "libsql://your-db.turso.io",
      "authToken": "your-token"
    }
  }
}

Via API

Use the /api/database/config endpoint to get or set the provider programmatically.

Database schema

Two tables are used:

user_settings

ColumnTypeDescription
idTEXT (PK)Setting identifier
project_orderTEXTJSON array of project slugs
updated_atINTEGERUnix timestamp

api_cache

ColumnTypeDescription
keyTEXT (PK)Cache key
routeTEXTAPI route that generated this cache
dataTEXTJSON-serialized response data
fetched_atINTEGERUnix timestamp when fetched
ttl_secondsINTEGERTime-to-live in seconds

Provider-specific setup

Turso

.env.local
DATABASE_PROVIDER=turso
TURSO_DATABASE_URL=libsql://your-db-name.turso.io
TURSO_AUTH_TOKEN=your-auth-token

Supabase

Configure via the Settings UI or .radarboard.json with your Supabase project URL and anon key.

PlanetScale

Configure via the Settings UI or .radarboard.json with your database host, username, and password.

Testing connection

Use the /api/database/test endpoint to verify your database connection before committing to a provider.

Migration

Use the /api/database/migrate endpoint to create the required tables in your chosen provider.