Getting startedComing from PocketBase
Coming from PocketBase
Concept mapping, developer workflow, and how to graduate from embedded SQLite to PostgreSQL forced RLS or MySQL/MariaDB without rewriting your frontend.
If you already know PocketBase, HydroGo feels immediately familiar: one Go executable, SQLite WAL out of the box, row-level access expressions (@auth.id == author_id), realtime SSE subscriptions, and an embedded Admin Studio. The difference is that HydroGo is designed to stay git-reviewable and scale smoothly into PostgreSQL forced Row-Level Security or MySQL without changing application code.
Concept mapping
| PocketBase | HydroGo | Notes |
|---|---|---|
pb_data/data.db | hydro_data/hydro.db | Zero-config hydro serve creates ./hydro_data/hydro.db (SQLite WAL), ./hydro_data/media, and ./content-types automatically. |
| Admin UI Collections | content-types/*.yaml + Studio | Create schemas visually in Studio Content Types or edit plain YAML files in git; both stay in sync and migrate live. |
API Rules (@request.auth.id) | access_rules (@auth.id, public, member, admin) | Row-level expressions work identically in YAML and in the Studio visual rule selector. |
pb.collection("posts").getList(...) | client.collection("posts").list(...) | @hydrohq/client supports filter, expand, keyset cursor after, iterate(), and subscribe(). |
| Realtime SSE | GET /api/v1/content/{type}/subscribe | Built-in SSE event stream with Last-Event-ID resume and automatic reconnect in @hydrohq/client. |
| SQLite only | SQLite WAL, PostgreSQL (forced RLS), or MySQL | Start on SQLite locally and switch database.dialect to postgres or mysql when you need multi-instance concurrency, shared hosting MySQL, or tenant RLS. |
| Manual binary swap | Ed25519 updates + 60s .prev rollback | Signed binary updates verify checksums, snapshot SQLite, and roll back automatically if /healthz fails within 60 seconds. |
1. Five-second zero-config boot
Run ./hydro serve in an empty folder. HydroGo initializes ./hydro_data/hydro.db, applies all migrations, and prints a single-use browser setup link (/admin/setup?token=...) plus /api/v1/openapi.json.
BASH
./hydro serve
# Prints:
# Admin setup: http://127.0.0.1:8080/admin/setup?token=...
# API & Docs: http://127.0.0.1:8080/api/v1/openapi.json2. Migrate client code to @hydrohq/client
import PocketBase from 'pocketbase';
const pb = new PocketBase('https://api.example.com');
const page = await pb.collection('articles').getList(1, 20, {
filter: 'status = "published"',
expand: 'author',
});3. Moving from SQLite to PostgreSQL RLS or MySQL
- Export existing content cleanly with
hydro portable export --path export.json --config config.yaml. - Point
database.dialect: postgres(PostgreSQL 15+ with aNOSUPERUSER NOBYPASSRLSrole) ordatabase.dialect: mysql(MySQL 8+ / MariaDB) andHYDRO_DATABASE_DSNat your target database. - Run
hydro migrate --config config.yamland verify isolation withhydro portable import --path export.json --dry-runfollowed by--confirm.
Open Content Types → API Preview inside the Studio at any time to copy tailored
cURL, @hydrohq/client, and MCP snippets for each collection.