@async/db

Advanced Settings Atlas

Use these pages after the first JSON file works. They explain which knob changes source discovery, schema contracts, runtime persistence, exposed routes, operation refs, mock behavior, and generated artifacts.

db.config.js
stores.default = "json"
resources.orders.store = "appDb"
server.expose.rest = "registered-only"
operations.acceptRefs = "ref"
LayerWhat it controls
**source**Where data files and schema files live.
**runtime**Where writes and hydrated state land.
**public API**Which routes clients may call.

Decision map

QuestionDefaultAdvanced settingPage
Where do data files live?./dbdbDir, sourceDirConfiguration
When should schema drift fail?warnschema.unknownFieldsSchema contracts
Where do writes land?.db/statestores, resources.*.storeRuntime stores
Which routes are public?open local devserver.exposeServer routes
How do clients call stable contracts?raw RESToperations, refsOperations
How realistic should local responses feel?30–100msmock.delay, mock.errorsMocking
What belongs in git?ignore .dboutputs.*Generated files

Advanced pages

  1. **Configuration** — Use config when defaults stop matching the project shape.
  2. **Schema contracts** — Know what inference can prove and when explicit schema should take over.
  3. **Runtime stores** — Keep JSON where it fits and move only the resource that outgrows it.
  4. **Server routes** — Separate local data explorer routes from app-facing data routes.
  5. **Registered operations** — Expose reviewed callable refs instead of raw resource exploration.
  6. **Mocking** — Make loading, retry, and empty states visible while staying local.
  7. **Generated files** — Keep .db/ out of git, then deliberately commit generated types, manifests, or operation refs only when the app imports them.