Skip to content

v1.2.0

Choose a tag to compare

@github-actions github-actions released this 09 Sep 02:38
· 142 commits to main since this release

Added

  • PostgreSQL 18. schema.sql declares its version with -- sqlshape: postgres 18, and the schema
    and every statement are judged with 18's grammar and catalog: RETURNING old / new (with
    WITH (OLD AS ..., NEW AS ...)), WITHOUT OVERLAPS keys and PERIOD foreign keys, NOT ENFORCED
    constraints (which are no failure mode), named NOT NULL constraints, VIRTUAL generated columns,
    and 18's own checks (a JSON_VALUE DEFAULT whose collation is not the RETURNING type's, a JSON path
    that is not a jsonpath, stricter datetime and aclitem input, an outer-level aggregate over a nested
    CTE). pgtest and the migration commands run the declared version's PostgreSQL; diff, apply
    and verify-schema warn when the database runs another major version than the schema declares.
  • One proves a single row through a temporal key: the scalar columns fixed by equality and the
    range column equal to a known value or containing a known point (valid_at @> {{.Day}}::date).

Fixed

  • SELECT DISTINCT ON expressions are matched to the leading ORDER BY expressions by expression,
    not by where each was written; the same expression in both no longer fails with 42P10.
  • An UPDATE that assigns a generated column reports PostgreSQL's message (column "b" can only be updated to DEFAULT) rather than INSERT's.

Changed

  • schema.sql must declare its PostgreSQL version (-- sqlshape: postgres 17); a schema without
    the line is not read. Add the line to move from 1.1.
  • The parser (libpg_query) is compiled to WebAssembly and run by wazero instead of being linked
    through cgo. go install no longer needs a C compiler, and the binary is a plain Go build.
    Parse trees, error messages and positions are unchanged.
  • Prebuilt binaries for every platform, cross-compiled by one job: Linux, macOS and Windows, amd64
    and arm64 each (Windows and Intel macOS are new).