nikita-volkov / hasql

The fastest PostgreSQL libpq-based driver for Haskell
http://hackage.haskell.org/package/hasql
MIT License
519 stars 55 forks source link

how to decode a json row? #116

Closed clojurians-org closed 5 years ago

clojurians-org commented 5 years ago

i explore the hasql api, it seems split to results/result/row/value layer. the basic operator for combinator is value parser, the up to row->result/results.

i didn't find a way to get all fields name and all fields value, then combine it to a json row.

can you give me some suggestion how to do it?

clojurians-org commented 5 years ago

the array+element decoder <$ row_to_json seem can resolve it https://github.com/PostgREST/postgrest/blob/master/src/PostgREST/QueryBuilder/Private.hs