mirror of
https://github.com/ash-project/ash_postgres.git
synced 2024-09-21 05:53:18 +12:00
25 lines
831 B
Elixir
25 lines
831 B
Elixir
defmodule AshPostgres.ManualRelationship do
|
|
@moduledoc "A behavior for postgres-specific manual relationship functionality"
|
|
|
|
@callback ash_postgres_join(
|
|
source_query :: Ecto.Query.t(),
|
|
opts :: Keyword.t(),
|
|
current_binding :: term,
|
|
destination_binding :: term,
|
|
type :: :inner | :left,
|
|
destination_query :: Ecto.Query.t()
|
|
) :: {:ok, Ecto.Query.t()} | {:error, term}
|
|
|
|
@callback ash_postgres_subquery(
|
|
opts :: Keyword.t(),
|
|
current_binding :: term,
|
|
destination_binding :: term,
|
|
destination_query :: Ecto.Query.t()
|
|
) :: {:ok, Ecto.Query.t()} | {:error, term}
|
|
|
|
defmacro __using__(_) do
|
|
quote do
|
|
@behaviour AshPostgres.ManualRelationship
|
|
end
|
|
end
|
|
end
|