Closed fdietze closed 1 year ago
The low-level protocol produces a List[Option[String]]
which is what you want, but there's no way to get to it through the provided interfaces. It could be done by modifying Query
to know that the result is dynamic in order to selectively bypass arity/type checking.
That sounds sufficient, thank you!
How do we proceed? Is it something you can do quickly, or should I get my hands dirty?
I think I'll approach this soon. What would be the rough steps to implement it?
(originally asked on discord: https://discord.com/channels/632277896739946517/839844929877704785/977322704363479050)
I need to query a table where the schema is not known at compile time. That means I'd like to do a
select * from dynamicTable
and get anArray[String | null]
for every row, which I can further process according to the types I know at runtime.Low-level types in the array would also be ok, since I can cast them accordingly. But I need to know if a field is null or not.
So far in ScalaJS, it seems like I'm stuck with with
pg-node
and use theirrowmode: 'array'
feature (https://node-postgres.com/features/queries)