Skip to content

Deny passing Buffer columns to SQLite JSON helpers. #1687

@igalklebanov

Description

@igalklebanov

Hey 👋

SQLite errors with SqliteError: JSON cannot hold BLOB values when a binary typed column or literal are passed to JSON functions.

The usual workaround is to omit such values from the data passed to these functions, or to cast the binary values to text or similar.

Currently, our SQLite JSON helpers allow passing such values. They shouldn't.

It started happening in SQLite version 3.45.0 (Jan 15th 2024) with the introduction of JSONB.

For Kysely users, this started with better-sqlite3@9.4.0 (Feb 1st 2024).

The minimum Node.js version we support is 20. It is supported in better-sqlite3@^8.4.0 || ^9.0.0. Its EOL comes in April 30th, 2026.

So:

Breaking change for folks using better-sqlite3@<9.4.0.
Bug fix for folks using better-sqlite3@^9.4.0.

Metadata

Metadata

Assignees

Labels

bugSomething isn't workinghelpersRelated to library's helperssqliteRelated to sqlitetypescriptRelated to Typescript

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions