scaffold
Scaffold a simple project in the current directory, to get a new project going.
nschema scaffoldThis writes:
config.sql— the project’s provider/state configuration, asPROVIDER/BACKENDconfig blocks.config.env.prod.sql— a starter environment overlay.schemas/example.sql— a starter desired-schema file.
Edit those to point at your database and describe the schema you want, then
plan and apply.
scaffold resolves the latest plugin version compatible with this CLI and pins it in the generated versionattribute,
so the project is reproducible from the moment it’s created.
Options
Section titled “Options”-f,--force— scaffold even if the directory is not empty. Without it,scaffoldrefuses to run in a non-empty directory so it can’t clobber existing files.--provider <postgres|sqlite|sqlserver>— the database provider to scaffold for. Defaults topostgres.--backend <file|s3>— the state backend to scaffold for. Defaults tofile.
The .NET SDK and network access to your NuGet feed: scaffold resolves and restores the chosen plugin (shelling out
to dotnet) to read its template and pin its version. The built-in file backend needs no plugin.