Overview
defineConfig is the file okm reads. Each option is a page.
export default defineConfig({
schema: "./schema.ts",required database: process.env.DATABASE_URL!,or targets …,sections});
defineConfig is the file okm reads. Each option is a page.
okm reads okmodel.config.ts from the project directory. The file default-exports defineConfig from okmodel/migrate.
Refused
A missing okmodel.config.ts fails the import. An export that is not an object with a string schema is refused: okmodel.config.ts must default-export defineConfig(...).
Runtime
Node.js 22.18 or newer loads the config. bunx okm uses Node. bun --bun okm uses Bun.
The declaration
The list is how often you reach for each part while writing the file. schema and the target come first.
import { defineConfig } from "okmodel/migrate";
export default defineConfig({
schema: "./schema.ts",
database: process.env.DATABASE_URL!,
});| Order | Page | You use it for |
|---|---|---|
| 1 | Schema | schema is required. okm loads this file. |
| 2 | Database | database is one target named default. targets replaces it. |
| 3 | Tables | tables is a directory okm check reads for orphan table files. |
| 4 | Migrations | migrations is where okm generate writes SQL. |
| 5 | Out | out is where okm build writes the catalog. |
| 6 | Timeouts | timeouts sets lock_timeout and statement_timeout for apply. |
| 7 | Pooler | allowPooler skips the pooler-host refusal. |
| 8 | Lint from | lintFrom is the first migration id okm migrate check lints. |
| 9 | Backfill | backfill sets batch size, pause, and batch statement timeout. |
| 10 | Roles | roles names migration, app, and optional reporting grants. |
| 11 | Namespace | namespace is the Postgres schema this catalog owns. |
| 12 | External | external lists catalog snapshots this project verifies. |