fmt
Reformats your .sql DDL files to a canonical layout.
Formatting is gentle: it normalizes layout (one blank line between statements, one member per line indented two
spaces inside CREATE TABLE and config blocks, canonical(/) placement) while preserving your content verbatim.
It is idempotent, and deliberately does not rewrite content the exact way import canonicalizes it.
nschema fmt # format every .sql file under the current directorynschema fmt ./schemas/users.sql # format a single filenschema fmt --check # CI: fail if anything is unformattedcat users.sql | nschema fmt - # format stdin to stdoutnschema fmt [path] rewrites a single .sql file, or every .sql file found recursively under a directory, in place,
and lists the files it changed. path defaults to the current directory.
Options
Section titled “Options”--check— write nothing; list the files that need formatting and exit2if any do (errors exit1). For CI.nschema fmt -— read DDL from stdin and write the formatted result to stdout, for editor integration.
Nothing. It only reads and writes files.