Just a tiny teaser, you could write something like
Person { country => name }
And it will output the following SQL: -- target: postgres
SELECT country, array_agg(name) AS name FROM Person GROUP BY country