Skip to content

Local file

The local file backend persists state to a JSON file on the local filesystem. It’s the simplest option, good for a single operator, or for checking state into source control.

Declare it with a BACKEND file config block:

BACKEND file (
path = './nschema.state.json'
);
Attribute Type Description
path string Path to the state file. Relative paths resolve against the project directory.

A file backend is ideal when a single machine or person owns the state, like during local development, or a setup where the state file is committed to the repository. For a team or CI where many runners need one shared source of truth, consider using something like the Amazon S3 backend instead.

NSchema locks the state file during write operations so concurrent runs can’t corrupt it. See Locking.