2023-08-07 17:47:06 +12:00
|
|
|
defmodule AshCubDB.Query do
|
|
|
|
@moduledoc """
|
|
|
|
A struct which holds information about a resource query as it is being built.
|
|
|
|
"""
|
|
|
|
|
2024-03-28 10:27:46 +13:00
|
|
|
alias Ash.{Domain, Filter, Resource}
|
2023-08-07 17:47:06 +12:00
|
|
|
|
|
|
|
defstruct aggregates: [],
|
2024-03-28 10:27:46 +13:00
|
|
|
domain: nil,
|
2023-08-07 17:47:06 +12:00
|
|
|
calculations: [],
|
|
|
|
distinct: nil,
|
|
|
|
distinct_sort: nil,
|
|
|
|
filter: nil,
|
|
|
|
limit: :infinity,
|
|
|
|
offset: 0,
|
|
|
|
relationships: %{},
|
|
|
|
resource: nil,
|
|
|
|
sort: nil,
|
|
|
|
tenant: nil
|
|
|
|
|
|
|
|
@type t :: %__MODULE__{
|
|
|
|
aggregates: [Resource.Aggregate.t()],
|
2024-03-28 10:27:46 +13:00
|
|
|
domain: Domain.t(),
|
2023-08-07 17:47:06 +12:00
|
|
|
calculations: [Resource.Calculation.t()],
|
|
|
|
distinct: Ash.Sort.t(),
|
|
|
|
distinct_sort: Ash.Sort.t(),
|
|
|
|
filter: nil | Filter.t(),
|
|
|
|
limit: :infinity | non_neg_integer(),
|
|
|
|
offset: non_neg_integer(),
|
|
|
|
relationships: %{optional(atom) => Ash.Resource.Relationships.relationship()},
|
|
|
|
resource: Ash.Resource.t(),
|
|
|
|
sort: nil | Ash.Sort.t(),
|
|
|
|
tenant: any
|
|
|
|
}
|
|
|
|
end
|