We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Description
Given to the documentation of Api.exists?:
Api.exists?
Wether or not the given query would return any results, raising any errors
However, it raise an error when multiple results are found.
To reproduce
# supposing you have multiple users MyApp.Api.exists?(User)
Raise:
↳ AshPostgres.DataLayer.run_aggregate_query/3, at: lib/data_layer.ex:738 ** (Ecto.MultipleResultsError) expected at most one result but got 5 in query: from u0 in MyApp.User, as: 0, select: %{} (ecto 3.10.3) lib/ecto/repo/queryable.ex:154: Ecto.Repo.Queryable.one/3 (ash_postgres 1.3.52) lib/data_layer.ex:738: AshPostgres.DataLayer.run_aggregate_query/3 (ash 2.14.21) lib/ash/actions/aggregate.ex:59: anonymous fn/5 in Ash.Actions.Aggregate.run/4 (elixir 1.15.6) lib/enum.ex:4830: Enumerable.List.reduce/3 (elixir 1.15.6) lib/enum.ex:2564: Enum.reduce_while/3 (djo 0.1.0) lib/djo/api.ex:1: MyApp.Api.exists?/2 iex:36: (file)
Expected behavior
Api.exists? should return true if multiple results are found.
Runtime
ash
ash_postgres
The text was updated successfully, but these errors were encountered:
Something seems strange here for sure, will investigate. You're on the latest version of ash and ash_postgres?
Sorry, something went wrong.
Yes, I currently use ash v2.15.10 and ash_postgres v1.3.52.
No branches or pull requests
Description
Given to the documentation of
Api.exists?
:However, it raise an error when multiple results are found.
To reproduce
Raise:
Expected behavior
Api.exists?
should return true if multiple results are found.Runtime
ash
version: 2.15.10ash_postgres
version: 1.3.52The text was updated successfully, but these errors were encountered: