Skip to content

v4.7.0

Choose a tag to compare

@58bits 58bits released this 24 Jul 14:20

Highlights

  • @byline/core / @byline/db-postgres — the database-adapter seam was hardened ahead of a second adapter. The dialect-independent storage machinery — flattenFieldSetData, restoreFieldSetData, resolveStoreTypes, the UnifiedFieldValue / FlattenedFieldValue row types, and the store-column manifest data (storeColumnManifest, storeTableNames) — now lives in @byline/core and is exported from its root, so any IDbAdapter implementation can consume the same flatten/reconstruct pipeline and column manifest without depending on the Postgres adapter. @byline/db-postgres keeps its own SQL generation (storeSelectList, pgNullCast) and gained a normalizeRow seam that canonicalises raw driver rows before they reach the shared reconstruct code. This move is non-breaking: these symbols were internal to @byline/db-postgres and were never re-exported from its package root, so no existing import path changes.

  • monorepo — a new private, unpublished @byline/db-conformance package holds a parameterised behavioural conformance suite that any IDbAdapter can run against its own test database. @byline/db-postgres now runs its storage, audit, counters, and admin integration tests through that suite (tests/conformance.integration.test.ts) with no coverage dropped or weakened. It is the correctness gate for the forthcoming second adapter.

Bug Fixes

  • @byline/db-postgres — closed a race in ensureCounterGroup. Two processes creating the same brand-new counter sequence concurrently could both pass Postgres's CREATE SEQUENCE IF NOT EXISTS existence check and race on the catalog insert, surfacing a duplicate-object error (SQLSTATE 23505) despite the IF NOT EXISTS. The adapter now absorbs that specific error as success, leaving every other error path untouched.

  • @byline/db-postgres — the hand-written sql/ upgrade scripts now enforce a canonical ownership guard. When one of the numbered sql/ scripts was applied as a superuser rather than the application's database role, any table it created was left owned by that superuser, and the running server (which connects as the app role) then hit permission denied. Every sql/ script that creates a table now reassigns ownership of mis-owned public objects back to the database owner before commit, and a CI test fails the build if a table-creating script omits the guard. This matters to self-hosters who apply the numbered sql/ scripts by hand.

Chores

  • @byline/coreUnionRowValue is now a deprecated alias of UnifiedFieldValue. The two were byte-identical row shapes; the alias keeps existing references compiling while UnifiedFieldValue becomes the single canonical name. Its file_size type widened to number | string | null to match what the driver actually returns for a BIGINT column. No action required.

  • monorepo — refreshed the storage benchmark sweep (2026-07-21) and realigned the benchmark harness with the current storage APIs. Internal tooling only; no consumer-facing change.

All other @byline/* packages bumped to 4.7.0 in lockstep with no behavioural changes this cycle.