check - check generated code sync
Check whether generated code is up to date with the configured SQL sources.
Usage
sh
norm check
norm check --target default
norm check -t default
norm check --diff
norm check --fix
norm check --strictOptions
--target,-t: Limit the check to a specific target.--diff: Show a unified diff for each stale file.--fix: Regenerate targets that are out of date. This is equivalent to runningnorm generatefor those targets.--strict: Exit with an error when no generated files exist to compare.
Behavior
- Runs generation logic for the selected target(s).
- Compares generated output with existing files in
gen.out. - Prints stale file paths when output is out of date.
- Exits with code
1when output is stale, or when--strictfinds nothing to compare.
Common errors
- Unknown target name in
--target. OUTOFDATEwhen generated files differ from current SQL (runnorm generateornorm check --fix).