Use this when you know the local contract before you have real records. It defines resources with .schema.jsonc, including a type-only collection with no seed records.
- db/users.schema.jsonc: collection with seed data.
- db/settings.schema.jsonc: singleton document schema.
- db/auditEvents.schema.jsonc: schema-only collection with an empty runtime state.
- src/generated/db.types.d.ts: committed generated types.
From the repository root, use the repo-internal CLI path:
pnpm run db -- sync --cwd ./examples/schema-first
pnpm run db -- serve --cwd ./examples/schema-firstOpen the local data explorer:
http://127.0.0.1:7331/__dbsync initializes empty runtime state for schema-only resources and writes committed generated types.
Leave serve running and run this from another terminal:
curl http://127.0.0.1:7331/db/audit-events.jsonGenerated .db/ output is ignored by git and can be removed whenever you want a fresh mirror.