-
Notifications
You must be signed in to change notification settings - Fork 55
Closed
Description
I'm getting an error "Distinct not supported in expressions", coming from:
ecto_sqlite3/lib/ecto/adapters/sqlite3/connection.ex
Lines 1463 to 1473 in a04c249
| defp expr({fun, _, args}, sources, query) when is_atom(fun) and is_list(args) do | |
| {modifier, args} = | |
| case args do | |
| [_rest, :distinct] -> | |
| raise Ecto.QueryError, | |
| query: query, | |
| message: "Distinct not supported in expressions" | |
| _ -> | |
| {[], args} | |
| end |
My query is like:
from(
s in SomeSchema,
where: s.tenancy_id == ^tenancy_id,
select: %{
users_count: count(s.user_id, :distinct)
}
)
|> App.Repo.one()Is there a supported way to write the query other than using a fragment?
Metadata
Metadata
Assignees
Labels
No labels