Skip to content

3.3.0

Choose a tag to compare

@durlabhjain durlabhjain released this 10 Apr 03:44
· 25 commits to main since this release
9953bc8

What's Changed

  • SQL: Add compressed/serialized column support (gzip, gzipJson, json). Adds first-class support in Sql for compressed/serialized columns so callers can transparently gzip/gzip+JSON encode parameters on write and normalize (decompress/parse) result sets on read, with a configurable *_Binary naming suffix to keep DB storage and logical field names symmetric. Changes
    ** binaryColumnSuffix property added to Sql (default "_Binary"), overridable or clearable per instance.
    ** normalizeColumns(rows, columns) — synchronous method for decompressing/parsing result-set columns:
    *** gzip: decompresses the suffixed DB column to a UTF-8 string and writes it to the logical column name.
    *** gzipJson: decompresses and JSON-parses the suffixed column.
    *** json: parses the column value as JSON (not suffix-affected).
    *** Falls back to the direct column name if no suffixed column exists.
    *** Wraps each decompression/parse in try/catch and rethrows with column name, type, and row index for diagnosable errors; original error preserved as cause.
    *** Throws a TypeError (with column name, type, row index, and actual value type) when a gzip/gzipJson column value is present but is neither a Buffer nor a Uint8Array, preventing silent partial-normalization.
    ** addParameters() updated for the new types:
    *** gzip/gzipJson values are compressed with zlib.gzipSync; only fieldName is suffixed (e.g. Memo → Memo_Binary as the DB column target), while the bound parameter name (paramName) keeps its original value so stored procedures and hand-written SQL continue binding @memo as-is.
    *** json values are serialized to a JSON string; no suffix applied.
    *** Buffer inputs to gzip/gzipJson throw a TypeError to enforce the text-only contract and prevent silent data corruption on round-trip.
    *** enums.columnTypes extended with gzip, gzipJson, and json values.

Full Changelog: 3.2.0...3.3.0