Core
3.4.0
Added
Doctoroperation.NSchemaApplication.Doctor(DoctorArguments)runs read-only health checks against the configured infrastructure.IStateLock.Peek. Reads the held lock (ornullwhen free) without acquiring it, so a diagnostic never contends with a real operation. Added as a default interface method (returnsnull), so existing implementers are source-compatible.- Force-unlock by id.
ForceUnlockArguments.ExpectedLockIdmakesForceUnlocka compare-and-swap: refused with aStateLockMismatchExceptionunless it matches the held lock. Unset keeps the previous “remove whatever is held” behavior.
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
Triggernow has an optionalBodyto take an statement body, alongside the existingFunctionthat Postgres uses. The two are mutually exclusive: a trigger either executes a function, or runs an inline body (SQL Server).Bodyis optional and defaults tonull, 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
AlterColumnTypeandAlterColumnNullabilityactions now include both the desired type and nullability. Both are optional and default tonull, so the change is source-compatible. A modified column’sColumnDiff.Definitionis 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.