How to create a Union query within different resources with Combination
Looks like the api to perform a Union query is https://hexdocs.pm/ash/combination-queries.html but what would be the best way to create a union query between different resources?
5 Replies
At the moment a generic action is the only thing that can return a union
As an action
that's fine, but how can I run a union query from two different resources?
oh, sorry, you mean using combination queries
you cannot currently
You would need to use ecto in some fashion, or create a postgres view for example
what about a sql fragment?
I don't really want to upkeep with a mirror ecto schema
All
Ash.Resource
modules are also Ecto.Schema
modules
works
There are some limitations (assoc
doesn't work)