-
-
Notifications
You must be signed in to change notification settings - Fork 23
Open
Description
Using jsr:@db/sqlite@0.13.0, I'm unable to read values from the DB if they contain a NUL in them (the value is truncated)
import * as sqlite from 'jsr:@db/sqlite'
const db = new sqlite.Database('./example.db')
db.run('CREATE TABLE IF NOT EXISTS Data(key TEXT NOT NULL PRIMARY KEY, value TEXT NOT NULL)')
const readStatement = db.prepare('SELECT value FROM Data WHERE key = ?')
const writeStatement = db.prepare('REPLACE INTO Data(key, value) VALUES(?, ?)')
writeStatement.run('foo', 'bar\x00baz')
console.error(readStatement.get('foo'))
// Result is `{ value: "bar" }` but it should have been `{ value: "bar\x00baz" }`, or a buffer with "bar\x00baz"
// Opening the DB with SQLite shows the correct valuesMetadata
Metadata
Assignees
Labels
No labels