Is there a way to express full outer join in Ash-Postgres?
I have a need to display records from either or both of the two resources in my project.
There is not a simple way to do that. It depends on how you structure it. You can create a resource that does not have a data layer, and has an attribute that is a union of the two types, and then use a manual or generic action on that resource to make your queries (using Ash or ecto or w/e you need), i.e
defmodule Foo do
use Ash.Resource
attributes do
attribute :thing, :union do
constraints types: [
a: [
type: :struct,
constraints: [instance_of: A]
],
b: [
type: :struct,
constraints: [instance_of: B]
]
]
end
end
end
Thank you!
1 Like