improvement: properly show unsupported error expression

This commit is contained in:
Zach Daniel 2024-03-22 14:20:38 -04:00
parent 5a513a82c2
commit ec75b41dbe
2 changed files with 7 additions and 0 deletions

View file

@ -3,6 +3,7 @@ This file was generated by Spark. Do not edit it by hand.
-->
# DSL: AshPostgres.DataLayer
A postgres data layer that leverages Ecto's postgres capabilities.
## postgres

View file

@ -515,6 +515,12 @@ defmodule AshPostgres.DataLayer do
def can?(_, :timeout), do: true
def can?(_, :expr_error), do: true
def can?(resource, {:filter_expr, %Ash.Query.Function.Error{}}) do
"ash-functions" in AshPostgres.DataLayer.Info.repo(resource, :read).installed_extensions() &&
"ash-functions" in AshPostgres.DataLayer.Info.repo(resource, :mutate).installed_extensions()
end
def can?(_, {:filter_expr, _}), do: true
def can?(_, :nested_expressions), do: true
def can?(_, {:query_aggregate, _}), do: true