From 78b46daf3ce50f4d2461be88b154fd3f39869b51 Mon Sep 17 00:00:00 2001 From: Andrew <84246113+arstamm@users.noreply.github.com> Date: Tue, 13 Oct 2026 12:49:50 -0600 Subject: [PATCH 1/3] Fix: Add line to restore missing resource. --- lib/query.ex | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/query.ex b/lib/query.ex index 352290d..3942ff9 100644 --- a/lib/query.ex +++ b/lib/query.ex @@ -10,6 +10,7 @@ defmodule AshSql.Query do def resource_to_query(resource, implementation, domain \\ nil) do from(row in {implementation.table(resource) || "", resource}, []) + |> Ecto.Query.put_query_prefix(implementation.schema(resource)) |> Map.put(:__ash_domain__, domain) end From 5b032cbfe37f5cb52e9ed48e9cf29892848f9f9a Mon Sep 17 00:00:00 2001 From: Andrew <84246113+arstamm@users.noreply.github.com> Date: Tue, 13 Oct 2026 13:29:03 -0600 Subject: [PATCH 2/3] Fix: Update prefix to be added as the query is built instead of afterward. --- lib/query.ex | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/query.ex b/lib/query.ex index 3942ff9..2302e4d 100644 --- a/lib/query.ex +++ b/lib/query.ex @@ -9,7 +9,9 @@ defmodule AshSql.Query do require Ash.Expr def resource_to_query(resource, implementation, domain \\ nil) do - from(row in {implementation.table(resource) || "", resource}, []) + prefix = implementation.schema(resource) + + from(row in {implementation.table(resource) || "", resource}, prefix: ^prefix) |> Ecto.Query.put_query_prefix(implementation.schema(resource)) |> Map.put(:__ash_domain__, domain) end From 3aa40264366f23dbfac426bfdf5d7ce690f4881a Mon Sep 17 00:00:00 2001 From: Andrew <84246113+arstamm@users.noreply.github.com> Date: Wed, 14 Oct 2026 22:46:18 -0600 Subject: [PATCH 3/3] fix: Remove unneeded line. --- lib/query.ex | 1 - 1 file changed, 1 deletion(-) diff --git a/lib/query.ex b/lib/query.ex index 2302e4d..fbad681 100644 --- a/lib/query.ex +++ b/lib/query.ex @@ -12,7 +12,6 @@ defmodule AshSql.Query do prefix = implementation.schema(resource) from(row in {implementation.table(resource) || "", resource}, prefix: ^prefix) - |> Ecto.Query.put_query_prefix(implementation.schema(resource)) |> Map.put(:__ash_domain__, domain) end