Changelog
💥 Breaking / Migration
arraySet(...)is now replacement-only. Out-of-bounds indexes are no-ops because it now usesjsonb_set(..., false). UsearrayPush(...)for append behavior.setPipe(...)no longer initializes SQLNULLroots implicitly. Use.$default(...)at the branch you want to create before nested writes.access(...).$pathis removed. Use.$valuefor JSONB extraction or.$textfor text extraction.
🐘 PostgreSQL Compatibility
- JSON helpers no longer rely on
json_query(...). - Effective PostgreSQL support now goes down to PostgreSQL 14 instead of PostgreSQL 17.
- CI now verifies the package against real PostgreSQL 14, 15, 16, 17, and 18.
🚀 JSON Helpers
Containment
- Added
contains(...)for typed JSONB containment predicates. json.contains(source).path.$contains(value)emits rootsource @> value, so full-column GIN andjsonb_path_opsindexes can be used.- Added direct containment form:
json.contains(source, value). contains(...)accepts SQL containment values at the root; nested proxy paths intentionally reject SQL values.
Updates and Defaults
.$default(...)now handles SQLNULLroots by initializing the root to{}before applying branch defaults.setPipe(...)now preserves SQLNULLunless a step explicitly creates the branch with.$default(...).
SQL Values
build(...)now supports computed SQL expressions inside JSON structures.- SQL expressions embedded into JSONB are wrapped with
to_jsonb(...); plain JavaScript values stay parameterized. coalesce(...)now handles JavaScript and SQL fallback values throughjsonBuild(...).
Arrays
arrayPush(...)appends values in order and treats SQLNULL/ JSONnulltargets as[].arraySet(...)replaces an existing element only; out-of-bounds indexes are no-ops.arrayDelete(...)removes an existing element; out-of-bounds indexes are no-ops.arrayPush(...)andarraySet(...)map JavaScriptundefinedto JSONnull.
🕒 Temporal
- Temporal custom columns are updated for newer Drizzle ORM RC custom type behavior.
- Temporal columns now decode correctly in Drizzle relational query builder results, including nested
oneandmanyrelations. monthDay.constraints(...)now validates month-specific day bounds, e.g. rejects02-30.yearMonth.constraints(...)now supports Temporal-compatible signed expanded years and enforces Temporal range boundaries.- Temporal docs now include insert, select, filter, SQL expression, and relational query examples.
✅ Tests / CI
- Added real PostgreSQL-backed integration tests, beyond the previous PGlite-only coverage.
- Added JSONB index tests proving
contains(...)works with full-column GIN andjsonb_path_opsindexes. - Added expression-index coverage for accessor-based predicates.
- Added SQL injection coverage for JSON access, build, coalesce, merge, set, setPipe, contains, and array helpers.
- Added Temporal relational query builder decoding coverage.
📦 Dependencies
drizzle-orm:1.0.0-rc.1->1.0.0-rc.3temporal-polyfill: development/test version updated to^1.0.1; peer range remains^0.3.2.
📚 Docs / Skill
- Expanded JSON docs with helper semantics, index guidance, SQL values, array behavior, and migration notes.
- Expanded Temporal docs with relational query builder behavior and query examples.
- Added
drizzle-pg-utilsagent skill with focused JSON subreferences and Temporal guidance.
Full Changelog: v0.5.0...v0.6.0