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.
File watch (kalam dev) — recommended
Enable both flags in kalam.toml:
Then run:
Behavior
- Poll
schema.sqlevery 2 seconds - On modification, debounce until the file is stable (handles editor save bursts)
- Diff against
kalam/.schema-baseline.sqland updatekalam/migrations/_draft.sql - Apply pending numbered migrations
- Regenerate TypeScript/Dart artifacts when
generate_types = true - Prompt to apply the draft (unless
kalam dev --force, which skips the modal — you still seal/apply through the prompt’s Apply path orkalam 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-schemais legacy server-side polling. It is not part of thekalam schemasubcommand and is not the recommended workflow. Preferkalam devwith aschema.sqlproject. 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:
| Option | Description |
|---|---|
--watch-schema | Enable 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-start | Run 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.