Ash FrameworkAF
Ash Framework3w ago
29 replies
Kai

"Virtual" Many-Many Resource?

Is there a way to create a virtual sort of many-to-many relationship?

I don't actually want to persist this, but basically for any combination of resource A and B there should exist a resource AB.

Is there some way to solve this in Ash? I figure there probably is given https://hexdocs.pm/ash/2.9.18/use-without-data-layers.html

But not sure how I should do the preparation. It's basically a many-to-many, so I guess my preparation has to do the join? Do I need a primary key, or can I use the two ids of the other resources as primary keys (like for other many-many resources?)
Was this page helpful?