kysely
kysely copied to clipboard
Select type does not override selectAll
With a query like
.selectAll('orders')
.select([
sql<string>`ENCODE(ordinal_order_id::bytea, 'hex')`.as('ordinal_order_id')
])
I'd expect ordinal_order_id in result to be string
type, but it ends up being Buffer & string
. In DB, ordinal_order_id is stored as bytea, so Buffer.
You're right, it should work the way you'd expect, but this one can be tricky to fix without causing typescript performance issues. If we figure out a fix, it will probably take some time. I'd suggest working around this by using a different alias.