I would like to be able to parse results returned by the following query using postgresql-simple.
psql> select 'string' as string, 1 as number, row (1,'hello') as "row with number and string", ARRAY[row(1,'hello'), row(2,'bye')] as "array of rows";
string | number | row with number and string | array of rows
--------+--------+----------------------------+-------------------------
string | 1 | (1,hello) | {"(1,hello)","(2,bye)"}
(1 row)
It doesn’t seem to be possible using the provided FromField / FromRow instances.
On the other hand hasql seems to have support for this kind of thing (viz Composite in Hasql.Decoders)
Is this scenario supported by postgresql-simple? If so could you please sketch how to implement it?