2 ms·
> So if you have a companies table joined to a contacts table, you'd get a two element tuple with a list of companies and a list of contacts, and then you have
by ParetoOptimal 5y ago
> So if you have a companies table joined to a contacts table, you'd get a two element tuple with a list of companies and a list of contacts, and then you have to iterate to do the joins and turn it into a JSON tree.
Esqueleto has a function to avoid n+1's and return a map now:
https://hackage.haskell.org/package/esqueleto-3.5.3.0/docs/Database-Esqueleto-Experimental.html#v:associateJoin https://hackage.haskell.org/package/esqueleto-3.5.3.0/docs/D...
https://www.foxhound.systems/blog/grouping-query-results-haskell/ https://www.foxhound.systems/blog/grouping-query-results-has...