Skip to Content
Schema Watch (Deprecated Flag)

Schema Watch

There is no kalam schema watch subcommand. The kalam schema command only exposes gen and pull.

For local development, schema watching is built into kalam dev. It polls schema.sql on disk, runs the migration pipeline, and regenerates SDK artifacts when configured.

Enable both flags in kalam.toml:

TOML
[schema]watch = true [dev]watch = trueapply_schema = truegenerate_types = true

Then run:

BASH
kalam dev

Behavior

  1. Poll schema.sql every 2 seconds
  2. On modification, debounce until the file is stable (handles editor save bursts)
  3. Diff against kalam/.schema-baseline.sql and update kalam/migrations/_draft.sql
  4. Apply pending numbered migrations
  5. Regenerate TypeScript/Dart artifacts when generate_types = true
  6. Prompt to apply the draft (unless kalam dev --force, which skips the modal — you still seal/apply through the prompt’s Apply path or kalam migration seal)

The watch loop runs alongside managed processes ([dev.processes]). Schema failures pause only the schema pipeline — other service logs keep streaming.

See Local Development and Migrations for the full pipeline.

Deprecated: kalam --watch-schema

Deprecated. kalam --watch-schema is legacy server-side polling. It is not part of the kalam schema subcommand and is not the recommended workflow. Prefer kalam dev with a schema.sql project. This flag may be removed in a future CLI release.

The old mode polled system.tables on the server and reran a shell command when remote DDL changed (for example via the admin UI). It required --run:

BASH
kalam --watch-schema --run "npm run schema:gen"
OptionDescription
--watch-schemaEnable remote polling mode (deprecated)
--namespace <NAME>Limit to namespaces (repeatable)
--table <namespace.table>Limit to tables (repeatable)
--run <COMMAND>Shell command after changes (required)
--run-on-startRun command once before polling
--interval <DURATION>Poll interval (default 5s; 500ms, 2s, 1m)

This mode does not read kalam.toml, manage migrations, or start child processes. Migrate to kalam init + kalam dev when possible.

Last updated on