Skip to content

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

@azmy60

Description

@azmy60

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions