nschema import
Read the live database schema and write it out as desired-schema source files. Use this to
adopt an existing database into NSchema: import it, then check the generated files into
source control and manage further changes with plan /
apply.
nschema import --out-dir ./schemasOptions
Section titled “Options”--out-dir <path>— directory to write the imported SQL files into. Defaults to the current directory.--scope <name>— limit the import to specific database schemas (namespaces). May be repeated.--force— overwrite existing.sqlfiles in the output directory. Without it,importrefuses to run against a directory that already contains.sqlfiles, so a re-import can’t silently clobber hand-edited schema (the same guardinitapplies to a non-empty directory).
See Adopting an existing database for the full workflow.