I tried to insert some binary data with Buffer objects, and when I fetched the data, it gave me the wrong result like:
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.