burrowDB and PocketBase¶
burrowDB is PocketBase v0.40.6 with PostgreSQL in place of SQLite and patches that let many replicas run side by side (engine/PATCHES.md lists every changed file). PocketBase's own test suite runs against PostgreSQL in this repository, and the few tests that cannot pass there are skipped with a reason, listed below.
This page is the complete list of differences. Anything it does not mention behaves as the PocketBase documentation says. Using the PocketBase docs goes through the PocketBase docs page by page.
Documentation policy
The PocketBase documentation stays the reference for the REST API, the SDKs, collections, API rules, auth and JS hooks. burrowDB's documentation covers only what burrowDB adds (replicas, deploys, operations, the CLI and MCP server, migration) and the differences on this page. When PocketBase's docs and this page disagree, this page wins for burrowDB.
The matrix¶
Unchanged: works as in PocketBase. Caveat: works, with a difference you need to know. Not supported: not available in burrowDB today.
Your app¶
| Feature | Status | Notes |
|---|---|---|
| REST API (records, collections, auth, files, batch, health) | Unchanged | Same routes, request and response shapes. A migrated app compared response by response showed no unexpected differences. |
| JavaScript and Dart SDKs | Unchanged | Point the SDK at the burrowDB URL. |
Dashboard (/_/) |
Unchanged | The same admin UI. The SQL console has extra guards (see Operations). |
| Collections: base, auth, view | Caveat | View collection queries are PostgreSQL SQL (Raw SQL). Collection, field and index names are limited to 63 bytes, PostgreSQL's identifier limit; longer names are rejected. |
| Field types | Unchanged | Stored as native types: JSONB, BOOLEAN, TIMESTAMP. |
| API rules and filters | Caveat | Rules and filters give the same results as on SQLite. PostgreSQL is stricter about types: a filter comparing a field with a value of an unrelated type (a text field > true, :length on a single-value field) returns an error where SQLite quietly coerced. |
| Sorting, expand, fields, pagination | Unchanged | |
| Auth: password, OAuth2, OTP, MFA, impersonation | Unchanged | Password hashes move over in a migration, so users keep signing in. OTP and verification mail need SMTP, as in PocketBase. |
| Realtime (SSE subscriptions) | Caveat | Works across replicas. Delivery is at most once: if a replica loses its PostgreSQL notification connection, or a client reconnects to another replica, events sent in between are missed. The replica drops its clients so the SDKs reconnect; refetch what the page shows on PB_CONNECT. |
| Files | Caveat | Local disk works for one process. With more than one replica, configure S3-compatible storage so every replica sees the same files. |
Server-side code¶
| Feature | Status | Notes |
|---|---|---|
JS hooks (pb_hooks/*.pb.js) |
Caveat | Load and run unchanged, but on every replica, and only when a process starts (no file watcher; restart the replicas after a change): in-memory state ($app.store(), globals) is per replica, and side effects must be safe to repeat. See Hooks at scale. |
cronAdd and the built-in jobs |
Caveat | Run only on worker (or all) processes, once per tick across the whole cluster. API replicas never run them. |
JS migrations (pb_migrations/*.js) |
Caveat | Applied once per deploy by the migrate step, under a lock, not by every replica. Automatic migration files from dashboard changes are off unless BURROW_AUTOMIGRATE=true. |
Raw SQL in hooks ($app.db()) |
Caveat | PostgreSQL SQL. See Raw SQL is PostgreSQL. |
| Extending with Go (PocketBase as a Go framework) | Not supported | burrowDB ships as the burrow binary and its server packages are internal. Use JS hooks, or fork the repository and add Go code to internal/server. |
Operations¶
| Feature | Status | Notes |
|---|---|---|
| Settings (dashboard and API) | Caveat | Work as in PocketBase. Settings you also set through BURROW_* variables (mail, S3, backups, app URL) are written again on every deploy, so set each in one place. Every replica must use the same BURROW_ENCRYPTION_KEY. |
| Logs (dashboard and API) | Unchanged | Stored in a second PostgreSQL database (BURROW_AUX_DB) shared by every replica. |
| Backups API and dashboard page | Caveat | Same zip on the outside; inside are pg_dump archives instead of SQLite files. A PocketBase backup cannot be restored into burrowDB, or the reverse: use Migrate from PocketBase. A restore swaps databases for the whole cluster. |
| SQL console | Caveat | PostgreSQL SQL. Each statement runs in a transaction (reads are read-only) with a time limit. COPY, server file functions, role and extension changes and session SET are refused. BURROW_SQL_CONSOLE=off or readonly restricts it further. See Operations. |
| Rate limiter | Caveat | Counts per replica: with N replicas the effective limit is up to N times the configured one. |
Server commands (serve, migrate, superuser) |
Caveat | The same commands under burrow (burrow serve, burrow superuser upsert). burrow migrate applies migrations once for the cluster before replicas start. The first superuser can also come from BURROW_SUPERUSER_EMAIL and BURROW_SUPERUSER_PASSWORD. Console commands added from JS hooks cannot be run: burrow hands only these three to the engine. See The burrow command. |
Single binary, data in pb_data |
Not supported | burrowDB needs PostgreSQL. burrow up local brings it up with Docker in one command. |
Raw SQL is PostgreSQL¶
Filters, rules and the API are translated for you. SQL you write yourself is not: $app.db() queries in
hooks, view collection queries and the SQL console run on PostgreSQL.
- Backtick-quoted identifiers are rewritten to double quotes, so
`posts`still works. strftime,hex,randomblob,json_validand anocasecollation are installed as functions so the SQL PocketBase itself generates keeps working. Other SQLite-only SQL must be ported:json_extractbecomes->>,datetime('now')becomesnow(),total()becomessum(),_rowid_does not exist.- Bind values with
{:param}placeholders as before.
// SQLite (PocketBase)
$app.db().newQuery("SELECT id FROM posts WHERE json_extract(meta, '$.lang') = {:lang}")
// PostgreSQL (burrowDB)
$app.db().newQuery("SELECT id FROM posts WHERE meta->>'lang' = {:lang}")
Skipped upstream tests¶
The upstream tests that are skipped on PostgreSQL, and why:
| Area | Reason |
|---|---|
| Concurrent and non-concurrent database builders | SQLite's single-writer split does not exist on PostgreSQL: all writes are concurrent |
| Deleting a view other views depend on | PostgreSQL refuses DROP VIEW with dependents; the collection delete path handles them |
A view test written with SQLite's total() |
The test SQL is SQLite-only |
A field named _rowid_ |
_rowid_ is a SQLite implicit column; on PostgreSQL it is an ordinary name |
| Generated migration text | Stored index SQL is quoted with double quotes instead of backticks; otherwise identical |
Filters with a type mismatch (:length on single-value fields, JSON against a boolean) |
PostgreSQL is type-strict where SQLite coerced (see API rules and filters above) |
Moving an app over¶
- Read this page and Hooks at scale, and port raw SQL in hooks and view queries.
- Configure S3-compatible storage if you will run more than one replica.
- Migrate the data with Migrate from PocketBase; it checks the copy record by record and compares API responses.
- Point your SDKs at the new URL, and refetch on
PB_CONNECTwhere pages rely on realtime.