@async/db

Configuration

The default path is one data folder (db/), generated output under .db/, JSON runtime state, open local routes, and inferred schema. Add config only when the defaults stop matching the app.

Common switches

NeedDefaultConfigure
Data folder (db/)./dbdbDir
Runtime storejsonstores.default
Resource overrideinheritresources.*.store
Strict fieldswarnschema.unknownFields
App route base/dbserver.dataPath
Tool route base/__dbserver.apiBase

A practical starting config

// @ts-check
import { defineConfig } from '@async/db/config';

export default defineConfig({
  outputs: {
    committedTypes: './src/generated/db.types.d.ts',
    operationRefs: './src/generated/db.operation-refs.json',
  },
  stores: {
    default: 'json',
  },
  mock: {
    delay: [30, 100],
  },
});

Config reads as a boundary document

AreaPurpose
**sources**Where data files and schema input come from.
**runtime**Where app writes and hydrated state should land.
**exposure**Which local and app-facing routes are allowed.

See also Configuration in the main guide for the full config map.