Handling has_many through relationships with ash + sqlite support

I have found this article on how to handle has_many through relationships in ash: Modelling `through` relationships with Ash | sevenseacat.net

The approach taken is to use no_attributes? true and filter the relationship.
This works nicely when using ash_postgres, but not when using ash_sqlite.

The issue is (again) that it is implemented via a lateral join and that isn’t supported in sqlite.

Is there a good alternative?

Hmm…I forget in what circumstances we have to use lateral joins for relationships with no attributes but I think that we can potentially carve out some cases where it’s not necessary depending on the filter? I’d have to look at the internals again. Could you make an issue with an example/repro?

Yeah, it seems like this should definitely be possible without any lateral join.

Ok, I’ve created an issue here with the adapted example repo from the blog: GitHub - spicychickensauce/ash_through_relationship_example at sqlite

Thanks for taking a look :folded_hands: