Use this after the basics when you want to see several features working together: mixed-mode data files, .schema.js, defaults, nested objects, and committed generated types.
- db/users.schema.js: schema helper API from
@async/db/schema. - db/users.json: data seed for the schema-backed
userscollection. - db/projects.schema.jsonc: nested object defaults.
- 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/advanced
pnpm run db -- serve --cwd ./examples/advancedOpen the local data explorer:
http://127.0.0.1:7331/__dbsync loads mixed data and schema sources, applies defaults in the selected runtime store, and writes committed generated types.
Leave serve running and run this from another terminal:
curl 'http://127.0.0.1:7331/db/projects.json?select=id,name,status,metadata'Generated .db/ output is ignored by git and can be removed whenever you want fresh runtime state.