Skip to content

Commit 3a08574

Browse files
committed
Test bytea parse and serialize
1 parent 7bbd1f9 commit 3a08574

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

tests/index.js

+9
Original file line numberDiff line numberDiff line change
@@ -568,3 +568,12 @@ t('notice hook works', async() => {
568568

569569
return ['NOTICE', notice.severity]
570570
})
571+
572+
t('bytea serializes and parses', async() => {
573+
const buf = Buffer.from('wat')
574+
575+
await sql`create table test (x bytea)`
576+
await sql`insert into test values (${ buf })`
577+
578+
return [0, Buffer.compare(buf, (await sql`select x from test`)[0].x)]
579+
})

0 commit comments

Comments
 (0)