QueryBuilder - Compose Ecto queries without effort

The idea is to simply inject all those defdelegates and the from_list function into the custom module. Except if I missed something? use allows you to inject code.

Nice, obviously I didn’t think about that case:) I think it’s easily solved with some reflection:
https://hexdocs.pm/ecto/Ecto.Schema.html#module-reflection

As a note to self, I think I’d also like at some point to implement select, because QueryBuilder is limited to fetching full entities right now.