Skip to content

Core

3.3.0

Changed

  • Dropping a schema now emits specific drop instructions for all known elements beneath. This is required for providers that don’t support cascading deletes.

3.2.1

Fixed

  • Fixed a bug where trailing comments would get merged when formatting DDL. They should now be preserved.
  • Fixed a bug where whitespace between comments and statements would get stripped when formatting DDL. It will now collapse to a single blank line.

3.2.0

More SQL Server Enhancements. A second gap found while building the SQL Server provider: its triggers carry their action as an inline statement body, not by calling a separate function as PostgreSQL’s do.

Added

  • Trigger now has an optional Body to take an statement body, alongside the existing Function that Postgres uses. The two are mutually exclusive: a trigger either executes a function, or runs an inline body (SQL Server). Body is optional and defaults to null, so the change is source-compatible, and it participates in structural equality (a body change is a drop + recreate, like any other structural trigger change).
  • The SQL DDL parser and writer accept and emit the inline form: CREATE TRIGGER … ON s.t AS $$ … $$ (dollar-quoted, so the body may contain its own ;), in addition to the existing … EXECUTE FUNCTION f(args) form.

3.1.0

SQL Server Enhancements. In working on the upcoming SQL Server provider, some functionality gaps were identified. This release goes towards enabling the SQL Server provider to work without hacks.

Added

  • When modifying a column’s type or nullability, SQL Server requires restating the full column definition. To facilitate this, the AlterColumnType and AlterColumnNullability actions now include both the desired type and nullability. Both are optional and default to null, so the change is source-compatible. A modified column’s ColumnDiff.Definition is now populated with the desired column, and the plan linearizer threads these final values onto the two actions.

3.0.0

First stable release. This release is a ground-up rewrite, reworking the NSchema library into a thin CLI wrapper around a new NSchema.Core.

The full Terraform-style lifecycle (plan / apply / destroy) etc. has been implemented along with features like saved plans, drift detection, backend state and locking.

See the new documentation site for all details: https://nschema.dev.