Skip to content

Round-trip SQLite BLOBs through NDJSON dumps - #16

Open
yushuosun wants to merge 1 commit into
simonw:mainfrom
yushuosun:fix/round-trip-blob-values
Open

yushuosun wants to merge 1 commit into
simonw:mainfrom
yushuosun:fix/round-trip-blob-values

Conversation

@yushuosun

Copy link
Copy Markdown

Closes #4.

Dump each binary value as a JSON object containing its base64 encoding, and decode that object during load. SQLite can mix storage classes within a column, so the marker applies per value. Plain text (including strings that resemble a marker) retains its type. Old repr-style strings remain text because the original storage class cannot be recovered reliably.

The CLI regression dumps and reloads a table containing binary bytes, an empty BLOB, strings, NULL, an integer and a float. It failed on the original loader and passes with the fix.

Python 3.12: python -m pytest -q with sqlite-utils 3.39.1: 7 passed, 1 skipped. With sqlite-utils 4.2.1: 6 passed, 1 skipped, 1 existing schema-format assertion failed both before and after the fix (identifier quoting). PR #15 separately handles AUTOINCREMENT sequences.

Copilot AI balanced review requested due to automatic review settings November 29, 2026 12:35

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Ability to round-trip binary data

2 participants