Describes a query validation issue found by a check.
Summary
Functions
Formats a query issue for human-readable error output.
Formats a query issue for human-readable error output.
Formats many query issues for human-readable error output.
Formats many query issues for human-readable error output.
Types
Functions
Formats a query issue for human-readable error output.
Metadata is omitted by default because issue messages are meant for humans and
often already contain the actionable details. Pass meta: true to include the
structured metadata for debugging.
Examples
iex> issue = %Bylaw.Ecto.Query.Issue{
...> check: MyApp.RequiredOrder,
...> message: "queries with limit require order_by",
...> meta: %{operation: :all}
...> }
iex> Bylaw.Ecto.Query.Issue.format(issue)
"MyApp.RequiredOrder: queries with limit require order_by"
iex> issue = %Bylaw.Ecto.Query.Issue{
...> check: MyApp.RequiredOrder,
...> message: "queries with limit require order_by",
...> meta: %{operation: :all}
...> }
iex> Bylaw.Ecto.Query.Issue.format(issue, meta: true)
"MyApp.RequiredOrder: queries with limit require order_by %{operation: :all}"
@spec format(t(), format_opts()) :: String.t()
Formats a query issue for human-readable error output.
Formats many query issues for human-readable error output.
Examples
iex> issues = [
...> %Bylaw.Ecto.Query.Issue{check: MyApp.RequiredOrder, message: "missing order"},
...> %Bylaw.Ecto.Query.Issue{check: MyApp.EmptyInPredicates, message: "empty in predicate"}
...> ]
iex> Bylaw.Ecto.Query.Issue.format_many(issues)
"MyApp.RequiredOrder: missing order\nMyApp.EmptyInPredicates: empty in predicate"
@spec format_many([t()], format_opts()) :: String.t()
Formats many query issues for human-readable error output.