prowdsponsor / esqueleto

Bare bones, type-safe EDSL for SQL queries on persistent backends.
http://hackage.haskell.org/package/esqueleto
BSD 3-Clause "New" or "Revised" License
177 stars 51 forks source link

no From instance for queries with more than 8 tables #113

Closed rubenmoor closed 8 years ago

rubenmoor commented 8 years ago

If I interpret my testing correctly, From instances go to a maximum of up to 8 entities. I have a query involving 10 tables. Is there a way to work around this limit w/o doing two queries?

meteficha commented 8 years ago

Ah, don't worry about it, I promise you'll probably never hit that limit in practice. And if you ever do, just use either nested tuples or one of the explicit joins.

rubenmoor commented 8 years ago

Alright! Replacing the tuple with InnerJoin did the trick for me. I did not design the table where this awful join was necessary ... never underestimate the power of European bureaucracy. They figured out how to do entity relations and now they nest them like there's no tomorrow.

meteficha commented 8 years ago

The "in practice" comment was more about being slightly easier to use InnerJoin when there are many tables, at least IMHO. :)