Skip to main content
HydroGo
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

PocketBaseHydroGoNotes
pb_data/data.dbhydro_data/hydro.dbZero-config hydro serve creates ./hydro_data/hydro.db (SQLite WAL), ./hydro_data/media, and ./content-types automatically.
Admin UI Collectionscontent-types/*.yaml + StudioCreate 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 SSEGET /api/v1/content/{type}/subscribeBuilt-in SSE event stream with Last-Event-ID resume and automatic reconnect in @hydrohq/client.
SQLite onlySQLite WAL, PostgreSQL (forced RLS), or MySQLStart 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 swapEd25519 updates + 60s .prev rollbackSigned 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.json

2. 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

  1. Export existing content cleanly with hydro portable export --path export.json --config config.yaml.
  2. Point database.dialect: postgres (PostgreSQL 15+ with a NOSUPERUSER NOBYPASSRLS role) or database.dialect: mysql (MySQL 8+ / MariaDB) and HYDRO_DATABASE_DSN at your target database.
  3. Run hydro migrate --config config.yaml and verify isolation with hydro portable import --path export.json --dry-run followed 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.