knex-libsql inserting wrong binary values on remote connection
Open
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 11
- Forks
- 0
- PR merge metrics
- No merged PRs in 30d
Description
I tried to insert some binary data with Buffer objects, and when I fetched the data, it gave me the wrong result like:
[ { id: 'ޭ��' } ]
To replicate:
await knex.schema.createTable("binary_data", (table) => {
table.binary("id", 4)
})
await knex.table('binary_data').insert({ id: Buffer.from([0xde, 0xad, 0xbe, 0xef]) })
console.log(await this.knex.select().from('binary_data')) // output: [{ id: 'ޭ��' }]
I can replicate this when I connect to a remote database. Memory or file database works fine.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by running the provided reproduction against a remote database and compare its binary result with the memory and file database cases. Trace the remote connection's handling of the Buffer value and verify that selecting the inserted four-byte value returns the original binary data rather than a corrupted string.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, sqlite
- Domain
- backend, database
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 52/100