Skip to content

runtime: SQLite BLOB columns as ArrayBuffer, BLOB binding - #73

Open
ResurrectedTrader wants to merge 1 commit into
mainfrom
sqlite-blob
Open

ResurrectedTrader wants to merge 1 commit into
mainfrom
sqlite-blob

Conversation

@ResurrectedTrader

Copy link
Copy Markdown
Owner

Summary

  • DBStatement.getObject() / getColumnValue() return a BLOB column as a fresh ArrayBuffer instead of throwing "Blob type not supported (yet)" (an empty BLOB is an empty buffer).
  • DBStatement.bind() and SQLite.query() parameters accept an ArrayBuffer, typed array or DataView and bind a BLOB of its bytes (copied); an empty one binds a zero-length BLOB, not NULL.
  • The README caveat about BLOB columns goes.

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): builds
  • build.ps1 test: 169/169 pass
  • build.ps1 check-format: clean

🤖 Generated with Claude Code

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

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.

1 participant