@typed-sql/postgres 2.1.0-rc.1 → 2.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/CHANGELOG.md +142 -0
  2. package/package.json +5 -5
package/CHANGELOG.md CHANGED
@@ -1,5 +1,147 @@
1
1
  # @typed-sql/postgres
2
2
 
3
+ ## 2.1.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 1041bfa: Add the grammar-neutral parser toolkit and move first-party parsing, ASTs, tokenization, and walking into each grammar package. The historical multi-dialect AST parser is isolated as a deprecated typed-sql 2.x compatibility surface for removal in 3.0.
8
+ - 1041bfa: Allow non-empty arrays of typed SQL fragments to be interpolated directly as homogeneous,
9
+ comma-separated structure. Add fail-closed compiler analysis for direct map callbacks and fragment
10
+ literals, cardinality-independent artifacts, bounded prepared-cardinality caches, shared grammar
11
+ conformance, and runtime limits while preserving ordinary arrays as single bound values.
12
+ - 1041bfa: Complete PostgreSQL grouping-set, ordered/hypothetical aggregate, window-frame, lateral function,
13
+ `ROWS FROM`, ordinality, table-sampling, and pagination analysis. Grouping legality, window
14
+ inheritance and modifiers, record-returning functions, null-padded function rows, and version-stable
15
+ query clauses now infer exact or deliberately conservative types with source diagnostics.
16
+ - 1041bfa: Infer PostgreSQL `UNION`, `INTERSECT`, and `EXCEPT` rows and recursive CTE seed/member contracts,
17
+ including PostgreSQL 14+ `SEARCH` and `CYCLE` generated columns. Invalid compound arity, missing
18
+ `WITH RECURSIVE`, misplaced seed terms, unsafe self-reference shapes, and invalid generated-column
19
+ references now fail closed with stable diagnostics and source spans.
20
+ - 1041bfa: Add a public, versioned PostgreSQL extension manifest API for types, routines, operators, casts,
21
+ codecs, and optional driver-neutral introspection. Manifests activate from installed extension
22
+ version evidence, participate in fail-closed query analysis and snapshot generation, and report
23
+ unsupported versions or conflicting declarations with stable diagnostics.
24
+ - 1041bfa: Complete PostgreSQL snapshot v2 introspection evidence for partition relationships, partition
25
+ strategies, search-path and role-scoped catalog visibility, routine parallel safety, record results,
26
+ and distinct `anyelement` and `anycompatible` polymorphic families. The provider keeps role names
27
+ out of serialized artifacts while making the visibility boundary explicit.
28
+ - 1041bfa: Harden PostgreSQL execution with policy-owned scalar and array codecs, runtime extension codec OID
29
+ resolution, generated-snapshot compatibility checks, bounded per-connection prepared-statement
30
+ caches with schema and search-path invalidation, and structured driver failure classifications.
31
+ Keep the shared `TSQ230` diagnostic registry text grammar-neutral.
32
+ - 1041bfa: Publish the grammar-owned PostgreSQL support policy for upstream-supported majors 14 through 18,
33
+ the exact current minor selected for each differential target, PostgreSQL 19 beta as a canary, and
34
+ the deprecation window used when an upstream major reaches end of life.
35
+ - 1041bfa: Resolve PostgreSQL operators and snapshot v2 routines through a grammar-owned candidate selector
36
+ that uses canonical types, cast contexts, preferred categories, unknown-literal rules, domains,
37
+ arrays, ranges, enums, and the `anyelement` and `anycompatible` polymorphic families.
38
+ Named, defaulted, expanded-variadic, and explicit-variadic routine calls now select against snapshot
39
+ argument evidence, while known invalid explicit casts produce a stable diagnostic.
40
+ The versioned core catalog now recognizes PostgreSQL temporal, bit-string, network, geometric,
41
+ full-text, XML, range, multirange, object-identifier, and related scalar types. Unary numeric and
42
+ bitwise operators, plus binary integer and bit-string operators, now resolve through typed
43
+ candidates and reject invalid operands. Date, timestamp, time, and interval arithmetic now uses
44
+ asymmetric PostgreSQL signatures, with parameter inference deferred until candidate selection.
45
+ Built-in range/multirange containment and arithmetic, network containment and address arithmetic,
46
+ full-text search composition, JSON-path predicates and deletion, and their multi-character tokens
47
+ now use exact grammar-owned signatures.
48
+ Geometric transformation, position, intersection, distance, containment, and relationship operators
49
+ now resolve through their exact operand and result signatures, including prefix forms.
50
+ Numeric promotion, mathematical prefix, bit-string shift, binary/JSON/text concatenation, money,
51
+ `pg_lsn`, and tuple-identifier operators now use catalog-derived signatures and coercions.
52
+ Array subscripts infer nullable element types, slices preserve the array type, omitted bounds are
53
+ represented explicitly, index parameters infer `integer`, and nested array mappings retain every dimension.
54
+ `ANY`, `SOME`, and `ALL` comparisons now resolve array elements or single-column subqueries through
55
+ the operator catalog, while row comparisons validate arity and select an operator for each field pair.
56
+ Parenthesized composite field selection now uses snapshot v2 field evidence for its database type,
57
+ TypeScript type, nullability, parameter context, and unknown-field diagnostics.
58
+ `COLLATE` now preserves collatable expression types, and `AT TIME ZONE` resolves PostgreSQL's exact
59
+ timestamp, timestamp-with-time-zone, and time-with-time-zone conversions with text or interval zones.
60
+ PostgreSQL 17 and newer also resolve and version-gate the corresponding `AT LOCAL` forms.
61
+ Scalar and row-valued `IN` lists and subqueries now validate equality candidates, numeric literals,
62
+ row arity, composite field comparability, nullability, and per-position parameter contexts.
63
+ The versioned cast catalogs now include every direct `pg_cast` conversion among shipped core types
64
+ for PostgreSQL 14 through 18, including the PostgreSQL 15 geometric removal and PostgreSQL 18
65
+ integer/bytea additions. Automatic assignment-to-string and explicit string I/O casts follow the
66
+ server's fallback conversion rules.
67
+ PostgreSQL interval literals now parse prefix precision, every valid field and field-range qualifier,
68
+ suffix second precision, and qualified interval cast types while retaining typed-literal source spans.
69
+ All forms resolve through the canonical `interval` type, and invalid field ranges fail during parsing.
70
+ JSON, JSONB, and JSONPATH typed literals now preserve their grammar-owned cast form. The core catalog
71
+ and resolver cover `jsonb_path_exists`, `jsonb_path_match`, query-array, query-first, and set-returning
72
+ query variants, including timezone-aware forms, optional variables/silent arguments, and nullability.
73
+ Database parameter identities are now retained even when their configured TypeScript mapping is
74
+ `unknown`, so JSON and other deliberately opaque codecs still produce typed prepared parameters.
75
+ PostgreSQL 17 and newer now parse and resolve the grammar-owned `JSON_EXISTS` SQL/JSON expression,
76
+ including formatted inputs, `PASSING` variables, error behavior, parameter identities, nullability,
77
+ and server-version diagnostics.
78
+ The grammar-owned PostgreSQL 17 `JSON_QUERY` form also resolves returning types, JSON output formats,
79
+ wrapper and quote behavior, constant `ON EMPTY` and `ON ERROR` defaults, and exact output nullability.
80
+ PostgreSQL 17 `JSON_VALUE` now resolves scalar return types and behaviors while preserving its
81
+ always-possible SQL null result for JSON null and rejecting unsupported collection or format clauses.
82
+ PostgreSQL 16 and newer now parse and resolve the standard `JSON_OBJECT` and `JSON_ARRAY`
83
+ constructors, including key/value and query forms, null handling, unique-key declarations, formatted
84
+ inputs, encoded returns, parameter identities, non-null output types, and server-version diagnostics.
85
+ Legacy and quoted `json_object(...)` calls remain ordinary catalog-backed routine calls.
86
+ PostgreSQL 17 and newer also own `JSON`, `JSON_SCALAR`, and `JSON_SERIALIZE`, including JSON-compatible
87
+ inputs, uniqueness declarations, scalar and composite conversion, string or binary returns, UTF-8
88
+ encoding, parameter inference, null propagation, and version diagnostics. The overlapping pre-17
89
+ functional `json(...)` cast keeps its earlier cast semantics.
90
+ PostgreSQL 16 and newer now own `IS JSON` and `IS NOT JSON` predicates across value, scalar,
91
+ array, object, and unique-key constraints, with JSON-compatible input validation, text parameter
92
+ inference, SQL-null propagation, and server-version diagnostics.
93
+ PostgreSQL 16 and newer now also own the standard `JSON_OBJECTAGG` and `JSON_ARRAYAGG` grammar,
94
+ including null and uniqueness clauses, aggregate-local ordering, `FILTER`, `OVER`, formatted inputs,
95
+ encoded returns, grouping validation, parameter inference, nullable empty-input results, and
96
+ server-version diagnostics.
97
+ PostgreSQL 17 `JSON_TABLE` now owns its table-reference grammar and resolves root, ordinality,
98
+ scalar, formatted, `EXISTS`, and nested columns with implicit lateral scope, alias lists, declared
99
+ types, behavior validation, nested null-padding, and server-version diagnostics.
100
+
101
+ Expose optional routine argument names and default evidence through the neutral resolver bridge so
102
+ grammar packages can implement named, defaulted, and variadic call selection.
103
+ - 1041bfa: Add deterministic generated PostgreSQL core catalogs for every supported major and the canary.
104
+ Type mapping, operator families, and built-in routine families now resolve from one version-selected
105
+ catalog revision instead of parallel hard-coded resolver lists.
106
+ - 1041bfa: Complete PostgreSQL DML parsing and analysis for identity overriding, `ON CONFLICT` targets and the
107
+ `excluded` namespace, row assignments, source-aware update/delete returning, versioned `MERGE`, and
108
+ PostgreSQL 18 old/new `RETURNING` aliases. Version-dependent forms now use server-major evidence and
109
+ fail closed when that evidence is absent or outside the feature's supported range. Snapshot v2 index
110
+ evidence now verifies expression, operator-class, collation, and partial-predicate conflict targets,
111
+ while insert/select, update, and merge writes propagate parameter types and reject known-incompatible
112
+ source types.
113
+
114
+ The neutral resolver snapshot bridge now exposes optional index and constraint-deferrability evidence
115
+ so grammar packages can consume schema v2 conflict-target metadata without importing schema internals.
116
+ - 1041bfa: Add canonical schema snapshot format 2 with isolated v1/v2 codecs, conservative v1 upgrades,
117
+ neutral relation/constraint/index/type/routine evidence, and complete provider introspection.
118
+ Resolvers now consume structural write and routine evidence, while drift, compatibility, manifests,
119
+ verification proofs, and plan artifacts bind to the schema format and canonical hash.
120
+
121
+ ### Patch Changes
122
+
123
+ - 1041bfa: Cache PostgreSQL operator and capability resolution per schema snapshot so version-complete semantic analysis remains inside the compiler performance budget.
124
+ - af8882c: Preserve domain evidence from legacy snapshots and schema-qualified v2 introspection during PostgreSQL operator resolution so parameters compared with domain-typed columns retain their inferred base type.
125
+ - 1041bfa: Add deterministic versioned dialect capability states backed by normalized server versions,
126
+ settings, extensions, and compile options. Query manifests now invalidate on capability changes and
127
+ record evidence for capabilities each query uses, while the CLI exposes a human-readable capability
128
+ report. The boolean capability map remains available as an additive migration bridge.
129
+ - Updated dependencies [1041bfa]
130
+ - Updated dependencies [1041bfa]
131
+ - Updated dependencies [1041bfa]
132
+ - Updated dependencies [1041bfa]
133
+ - Updated dependencies [1041bfa]
134
+ - Updated dependencies [1041bfa]
135
+ - Updated dependencies [1041bfa]
136
+ - Updated dependencies [1041bfa]
137
+ - Updated dependencies [1041bfa]
138
+ - Updated dependencies [1041bfa]
139
+ - Updated dependencies [1041bfa]
140
+ - Updated dependencies [1041bfa]
141
+ - @typed-sql/core@2.1.0
142
+ - @typed-sql/ast@2.1.0
143
+ - @typed-sql/schema@2.1.0
144
+
3
145
  ## 2.1.0-rc.1
4
146
 
5
147
  ### Patch Changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@typed-sql/postgres",
3
- "version": "2.1.0-rc.1",
3
+ "version": "2.1.0",
4
4
  "description": "PostgreSQL grammar, schema introspection, type resolution, and driver-neutral runtime codecs for typed-sql.",
5
5
  "license": "MIT",
6
6
  "author": "Lojhan",
@@ -39,12 +39,12 @@
39
39
  },
40
40
  "dependencies": {
41
41
  "@types/pg": "8.23.1",
42
- "@typed-sql/core": "2.1.0-rc.1",
43
- "@typed-sql/schema": "2.1.0-rc.1",
44
- "@typed-sql/ast": "2.1.0-rc.1"
42
+ "@typed-sql/ast": "2.1.0",
43
+ "@typed-sql/schema": "2.1.0",
44
+ "@typed-sql/core": "2.1.0"
45
45
  },
46
46
  "devDependencies": {
47
- "@typed-sql/conformance": "2.1.0-rc.1"
47
+ "@typed-sql/conformance": "2.1.0"
48
48
  },
49
49
  "scripts": {
50
50
  "test": "poku test --reporter=compact --enforce",