data-api-client
data-api-client copied to clipboard
Support for `array_agg` queries
Love this project @jeremydaly !!!
I have a set of queries where I join 2-3 tables together and rely on the built-in PostgreSQL functions for array_agg to collect array properties. This doesn't appear to be supported yet but it would be awesome if the result set parser could handle this.
Example query:
SELECT users.id, array_agg(memberships.id) AS audienceIds
FROM users
LEFT OUTER JOIN memberships ON users.id = memberships.user_id
GROUP BY users.id
Returns:
{ "id": 1, "audienceIds": { "longValues": [1, 2, 3] } }
Expected:
{ "id": 1, "audienceIds": [1, 2, 3] }
I'm working on a pretty meaty project for the next few weeks but if I free up I'm happy attempt a PR. Seems like it should be relatively simple.