Overview

defineConfig is the file okm reads. Each option is a page.

defineConfig()Anatomy
export default defineConfig({
schema: "./schema.ts",required
database: process.env.DATABASE_URL!,or targets
…,sections
});

Schema

schema is required. okm loads this file.

Database

database is one target named default. targets replaces it. Set database or targets. Both is refused.

Pages

Each other field is a page in this group.

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.

okmodel.config.ts
import { defineConfig } from "okmodel/migrate";

export default defineConfig({ 
  schema: "./schema.ts",
  database: process.env.DATABASE_URL!,
});
OrderPageYou use it for
1Schemaschema is required. okm loads this file.
2Databasedatabase is one target named default. targets replaces it.
3Tablestables is a directory okm check reads for orphan table files.
4Migrationsmigrations is where okm generate writes SQL.
5Outout is where okm build writes the catalog.
6Timeoutstimeouts sets lock_timeout and statement_timeout for apply.
7PoolerallowPooler skips the pooler-host refusal.
8Lint fromlintFrom is the first migration id okm migrate check lints.
9Backfillbackfill sets batch size, pause, and batch statement timeout.
10Rolesroles names migration, app, and optional reporting grants.
11Namespacenamespace is the Postgres schema this catalog owns.
12Externalexternal lists catalog snapshots this project verifies.

On this page