github gajus/slonik @slonik/sql-tag@49.6.0

latest releases: slonik-sql-tag-raw@49.7.0, @slonik/dataloaders@49.7.0, @slonik/types@49.7.0...
6 hours ago

Minor Changes

  • #803 7bb0a65 Thanks @gajus! - feat: relax SerializableValue and validate sql.jsonb / sql.json payloads

    • SerializableValue now accepts Record<string, unknown> and unknown[] for its
      recursive branches, so payloads from JSON.parse, external APIs, or generic
      event types no longer require a cast when passed to sql.jsonb / sql.json.
    • Payloads are now walked for characters PostgreSQL rejects in jsonb/json
      values (null byte U+0000 and unpaired UTF-16 surrogates). A
      descriptive InvalidInputError is thrown with the JSON path of the
      offending value (e.g. $.foo.bar[1]) instead of letting PostgreSQL fail
      the query with a generic error.
    • When JSON.stringify of a payload fails (e.g. BigInt), the resulting
      InvalidInputError now attaches the original error as cause so the
      underlying reason is recoverable without losing the static message.

Patch Changes

  • Updated dependencies [7bb0a65]:
    • @slonik/types@49.6.0
    • @slonik/errors@49.6.0

Don't miss a new slonik release

NewReleases is sending notifications on new releases.