Closed
Description
Inserting binary data by passing a Buffer
or ArrayBuffer
value works fine under the webhook client (handled by the underlying pg
implementation), but is unimplemented under the http client and silently breaks, instead inserting corrupted values representing the result of causing JSON.stringify()
on the Buffer
value.
Steps to reproduce
CREATE TABLE example (
binary_data BYTEA
);
const sql = neon(DATABASE_URL);
await sql`INSERT INTO example VALUES (${Buffer.from('test')})`
Expected result
SELECT CONVERT_FROM(binary_data, 'utf8') FROM example;
> 'test'
Actual result
SELECT CONVERT_FROM(binary_data, 'utf8') FROM example;
> '{"data":[xx, xx, xx...],"format":"Buffer"}'
Metadata
Metadata
Assignees
Labels
No labels