Skip to content

Installation

NSchema is deployed as a .NET tool named nschema.

  • .NET SDK 10.0 or later. The tool targets net10.0. Check with dotnet --version; install from dotnet.microsoft.com if needed.
  • A database. This tool is for managing database schemas after all. See Databases for supported databases.

These instructions assume you want to install nschema globally just for the sake of simplicity. If you just want to install it locally, you can do that too.

Terminal window
dotnet tool install nschema --global

This installs the nschema command onto your PATH. You can verify it using:

Terminal window
nschema --version

Database providers and remote state stores aren’t bundled with the CLI: each ships as its own NuGet package. When you need to use a plugin, declare it in a PLUGIN block, pinning the package source and version. NSchema will pin the selected version in a lockfile so runs are consistent. Source accepts any NuGet package ID, so third party plugins are supported.

PLUGIN postgres (
source = 'NSchema.Postgres',
version = '[5.0,6.0)'
);

The local file state store is the one exception to the plug-in system, as it’s built in. See Configuration.

Terminal window
dotnet tool update --global nschema
Terminal window
dotnet tool uninstall --global nschema

NSchema can emit a completion script for your shell, and install it for you in one step:

Terminal window
nschema completion install bash

Swap bash for zsh, fish, or pwsh. See the completion command for manual installation and completion uninstall to remove it.

With the tool installed, head to the Quickstart to scaffold a project and apply your first schema.