Skip to main content
supaschema.config.json is the project-owned place for persistent defaults. Read it as four decisions, not as a flat list of switches. Use the detailed field reference when the project needs a non-default path, source, generated-output policy, validator, or apply target.

Load order

supaschema looks for config in this order:
  1. --config <path> (.json)
  2. supaschema.config.json in the working directory
  3. Built-in defaults
Unknown keys are rejected, so typos fail loudly. The scaffolded config includes a $schema pointer to the shipped supaschema-config.schema.json, so editors can autocomplete and validate every key.
Keep real credentials in environment variables and reference them as $ENV_NAME. Provider config files such as supabase/config.toml, neon.toml, Terraform, Bicep, CloudFormation, or Cloud Build files are used only to seed install-time defaults.

Generated config

Generic PostgreSQL installs write explicit defaults so humans, agents, and editor schema validation agree on the same workflow. Schema tree and diff target:
schemaPaths is recursive. A root such as database/schemas can contain nested folders like database/schemas/app/tables.sql or database/schemas/auth/policies/read.sql; supaschema reads every nested .sql file and merges the parsed objects into one schema model. Its first entry is the only configured after-state owner. migrationsDir owns generated output, existing migration source intent, and generated-lineage baseline proof. Generated contracts:
Apply policy:
workflow.migration_sync: "auto" keeps bare supaschema sync enabled. Target mode decides what is selected, but only one target may be automatic because cross-target apply is not atomic. Set a target to "manual" to omit it from bare sync, set workflow.migration_sync to "manual" to require --target <name>, or set it to "disabled" to block apply. Provider detection can change the initial schemaPaths and migrationsDir values during install. Supabase installs also seed managedSchemas with the Supabase platform schema list and copy those names into schemas.exclude; generic PostgreSQL, Neon, RDS/Aurora, Cloud SQL, AlloyDB, and Azure PostgreSQL installs use managedSchemas: [] unless you configure otherwise.
For the object classes, provider surfaces, and unsupported DDL boundaries that determine what belongs in your declarative tree, see the support matrix.
The config schema is generated from src/config/schema.ts plus the shared contract in src/config/contract.ts into the shipped supaschema-config.schema.json. The installer consumes the generated bin/config-contract.mjs mirror from the same contract. This page is the public reference for those fields.

Adapter

adapter has one current value: auto. auto means provider-specific behavior is not selected through an adapter switch. Provider-specific setup is expressed through paths, managedSchemas, transactionMode, excludedGrantRoles, and explicit command flags such as verify --ensure-environment. Workflow consent lives in the workflow object.

Workflow policy

The workflow object is the machine-readable contract used by agent hooks, CLI defaults, generated contract guidance, migration automation, and deploy safety gates.

Options

Validate and repair

Use config validate when an agent or CI job needs a machine-readable check of path fields, source defaults, and inline credential risks:
If .supaschema/install.json records pending path confirmation, config validate exits with an error until supaschema.config.json explicitly sets schemaPaths and migrationsDir. Use init --dry-run --json to inspect what install would write before changing the repository:
Use init --repair to rewrite supaschema.config.json from the canonical contract. Existing JSON values are preserved where they are valid; removed keys and unsupported values fail instead of being repaired. A normal install or init run leaves an existing JSON config untouched.
JavaScript config files are not loaded or converted. Move persistent settings into supaschema.config.json.

Validators

internal-parser is always the correctness owner. Optional external validators run as subprocesses during check and verify:
  • squawk / squawk-cli — runs the squawk binary
  • pgls / postgres-language-server / @postgres-language-server/cli — runs postgres-language-server check
  • sqlfluff — runs the external Python sqlfluff lint --dialect postgres
A configured validator that is not installed produces SUPA_VALIDATOR_UNAVAILABLE as an error: configured checks may not silently skip.

Example

Last modified on July 15, 2026