Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/fuzzy-seas-reply.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@electric-sql/pglite': patch
---

Fix convert_to
28 changes: 28 additions & 0 deletions packages/pglite/tests/basic.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -932,5 +932,33 @@ await testEsmCjsAndDTC(async (importType) => {
rowCount: 1,
})
})
it('serialize with no concrete type', async () => {
const res0 = await db.exec(`SELECT 1`)

const res1 = await db.exec(`SELECT convert_to('abc', 'LATIN1')`)

expect(res1).toEqual([
{
rows: [
{
convert_to: new Uint8Array([97, 98, 99]),
},
],
fields: [
{
name: 'convert_to',
dataTypeID: 17,
},
],
command: 'SELECT',
affectedRows: 0,
rowCount: 1,
},
])

const res2 = await db.exec(`SELECT 1`)

expect(res2).toEqual(res0)
})
})
})
2 changes: 1 addition & 1 deletion postgres-pglite