Use this when an app wants committed schema metadata for admin, CMS, or form-building screens. It demonstrates outputs.schemaManifest and schemaManifest.customizeField().
- db/projects.schema.jsonc: relation, enum, defaults, and descriptions.
- db/users.schema.jsonc: field descriptions and a
biofield customized for markdown. - db.config.js: writes
src/generated/db.schema.jsonand customizes UI hints. - src/generated/db.schema.json: committed manifest output after sync.
From the repository root, use the repo-internal CLI path:
pnpm run db -- sync --cwd ./examples/schema-manifest
pnpm run db -- schema manifest --cwd ./examples/schema-manifest --out ./src/generated/db.schema.json
pnpm run db -- serve --cwd ./examples/schema-manifestsync writes both generated TypeScript types and a committed schema manifest. In the manifest, projects.status uses segmented-control, and users.bio uses markdown.
Leave serve running and run this from another terminal:
curl 'http://127.0.0.1:7331/db/projects.json?expand=owner&select=id,name,status,owner.name'Generated .db/ output is ignored by git. The files under src/generated/ are intentionally committed for this example.