How to expose (or use) a module attribute that is built using macros

Hi @eksperimental, I’m not sure I understood what you mean, but the attribute @counter_cache_fields could be passed to __query__/2 as the fields param, for instance. I purposefully didn’t include the function because I didn’t know where exactly to put it, but if you care to leave an example I’d appreciate that.

Interesting, I read the docs but it wasn’t immediately clear what this option did tbh. I’ll test that trick but I’d like to understand first if that’s really necessary (since Ecto doesn’t use this, I figure perhaps there’s another way).