Repository navigation
runtime: SQLite BLOB columns as ArrayBuffer, BLOB binding - #73
Open
ResurrectedTrader wants to merge 1 commit into
Open
ResurrectedTrader wants to merge 1 commit into
ResurrectedTrader wants to merge 1 commit into
Conversation
DBStatement.getObject() and getColumnValue() threw "Blob type not supported (yet)" on a BLOB column (as the reference d2bs did). They now return the column's bytes as a fresh ArrayBuffer (an empty BLOB is an empty buffer). The counterpart in BindValue (used by DBStatement.bind() and SQLite.query()'s parameters): an ArrayBuffer, typed array or DataView binds a BLOB of its bytes (sqlite3_bind_blob64, copied); an empty one binds a zero-length BLOB rather than NULL. kolbot does not use the SQLite API, so no shipped script depends on the throw. The README caveat saying BLOB columns are unsupported is removed. Script-visible behaviour: reading a BLOB column returns an ArrayBuffer instead of throwing; bind()/query() accept ArrayBuffer / typed arrays / DataView (previously a TypeError / "Invalid bound parameter"). Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
DBStatement.getObject()/getColumnValue()return a BLOB column as a freshArrayBufferinstead of throwing "Blob type not supported (yet)" (an empty BLOB is an empty buffer).DBStatement.bind()andSQLite.query()parameters accept anArrayBuffer, typed array orDataViewand bind a BLOB of its bytes (copied); an empty one binds a zero-length BLOB, not NULL.Script-visible: reading a BLOB column no longer throws; binding binary data no longer fails. kolbot does not use the SQLite API.
Verification
build.ps1 Release(Win32, the 1.14d DLL): buildsbuild.ps1 test: 169/169 passbuild.ps1 check-format: clean🤖 Generated with Claude Code