Skip to content

PostgreSQL

Version 5.0.0

v5.0 tracks the NSchema.Core 5.0 rearchitecture. The provider’s behaviour is unchanged; its seams follow the new core contracts.

Added

  • new asks for the connection details. The plugin declares host, port, database and username as scaffolding questions and composes the answers into the connection_string it writes. The password is deliberately not asked for — it belongs in NSCHEMA_DATABASE_PASSWORD.

Changed

  • Updated to NSchema.Core 5.0. The provider now plugs in the core’s SqlDialect (SQL rendering) and IDatabaseIntrospector (live-schema reading) seams.
  • UsePostgres replaces UseCurrentSchemaPostgres. The old name referenced a core concept that no longer exists; UsePostgresDialect replaces UsePostgresGenerator the same way.
  • The plugin is configured by a DATABASE statement. Configure takes the core’s typed PluginSettings and returns a Result; configuration problems are diagnostics.
  • An action this dialect cannot execute (e.g. making an existing plain column generated in place) now reports an error diagnostic on the plan instead of throwing.
  • Identifiers everywhere in generated SQL are quoted per the core’s case-sensitive identifier model; this now includes role names and trigger function references.
  • Revoking table privileges now revokes the specific privileges the plan names rather than ALL PRIVILEGES.
  • ON DELETE NO ACTION / ON UPDATE NO ACTION are no longer spelled out on added foreign keys (they are the engine default).
  • Schema-qualified user-defined type names are now quoted in generated SQL: a column typed as, say, app.order_status renders as "app"."order_status" rather than bare (an unqualified type name is still emitted as-is).
  • A user-defined type (enum, composite, …) is now read back schema-qualified during introspection instead of losing its schema, so it no longer produces a spurious diff against a schema-qualified declaration.
  • Postgres equivalence rules. UsePostgres now also registers PostgresSqlEquivalence (standalone: UsePostgresEquivalence) into the core’s comparison seam, so spellings the catalog and a project may legitimately disagree on compare equal in either direction. Introspection still captures exactly what the catalog reports.