Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

knex-libsql inserting wrong binary values on remote connection #4

Open
azmy60 opened this issue Jul 22, 2024 · 0 comments
Open

knex-libsql inserting wrong binary values on remote connection #4

azmy60 opened this issue Jul 22, 2024 · 0 comments

Comments

@azmy60
Copy link

azmy60 commented Jul 22, 2024

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.

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

No branches or pull requests

1 participant