Use this when you have fixture data before you have a contract. db infers collections, singleton documents, REST routes, GraphQL fields, and TypeScript types from plain JSON.
- db/users.json: collection inferred from an array.
- db/posts.json: second inferred collection.
- db/settings.json: singleton document inferred from an object.
From the repository root, use the repo-internal CLI path:
npm run db -- sync --cwd ./examples/data-first
npm run db -- serve --cwd ./examples/data-firstOpen the viewer:
http://127.0.0.1:7331/__dbsync infers schema and writes generated runtime state under examples/data-first/.db/.
Leave serve running and run this from another terminal:
curl 'http://127.0.0.1:7331/db/users.json?select=id,name,email'Generated .db/ output is ignored by git and can be removed whenever you want a fresh mirror.