BACKEND environment variable. This page explains how to set up each option, what gets stored in the database, and how to manage your data over time.
Choosing a backend
BACKEND=postgres | BACKEND=supabase | |
|---|---|---|
| Setup | Zero config with Docker Compose | Manual schema run in Supabase SQL editor |
| Auth | JWT-based, handled by the API | Supabase Auth (GoTrue) |
| Row-level security | No — API layer enforces access | Yes — RLS on all workspace tables |
| Best for | Fully local or air-gapped deployments | Easier auth management and a managed DB |
BACKEND=postgres. If you prefer a managed database with built-in auth, use BACKEND=supabase.
Setting up your database
- Postgres (self-hosted)
- Supabase (hosted)
When you use The default credentials (You’ll need to run
BACKEND=postgres with Docker Compose, the database is initialized automatically — no manual steps required.How initialization works
When you first start the stack withdocker compose up, the Postgres container runs the bundled initialization script automatically. All tables, indexes, and the local users table for JWT auth are created in a single pass — you don’t need to run any SQL manually.Environment variables
Add these to your.env:waterline/waterline) match the Postgres service definition in docker-compose.yml.Connecting an external Postgres instance
If you want to use your own Postgres server instead of the bundled container, pointDATABASE_URL at it:schemas/postgres_init.sql manually against that database on first setup:What Waterline stores
Waterline stores several categories of data in your database. The largest tables are the code symbol index and cached ticket results, which grow proportionally with repository size and analysis history.| Category | What’s stored |
|---|---|
| Workspaces and members | Users, workspaces, and access roles |
| Connected repositories | Which repos are linked to which workspace |
| Code symbol index | Function and class summaries with embeddings — one row per indexed symbol |
| Sync state | The last-processed commit SHA per repo (used for incremental sync) |
| Ticket progress cache | Cached analysis results per ticket and repository |
| Issue data | Fetched Jira and GitHub Issues content |
Backups
Postgres (Docker Compose) The database lives in thepostgres_data Docker volume. To create a backup:
postgres_data volume is lost if you run docker compose down -v.
Supabase
Supabase automatically creates daily backups on paid plans. You can also take a manual backup from Project Settings → Backups in the Supabase dashboard, or export your data using the Supabase CLI.
Resetting the database
- Postgres (self-hosted)
- Supabase (hosted)
Remove the
postgres_data volume and restart. Docker will re-run the init script on next start:Schema migrations
Waterline does not use an automatic migration runner. When you upgrade Waterline to a new version, check the changelog for any schema changes that need to be applied manually.- Postgres: look for new or updated SQL files in the
schemas/directory and run them against your Postgres instance withpsql "$DATABASE_URL" -f schemas/<migration>.sql - Supabase: run migration SQL files via the SQL Editor in your Supabase dashboard, in the order listed in the changelog
Always back up your database before applying schema changes, especially in production.