Skip to content
New issue

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

missing support for Tuple implementation of Ecto.Queryable protocol when using filter params #48

Closed
westonlit opened this issue Sep 10, 2024 · 0 comments · Fixed by #51

Comments

@westonlit
Copy link

Using a Tuple as the Queryable (to use a particular partition, for instance, like {"partitioned_table_1", Schema}) works if no params are passed:

EctoShorts.Actions.all({"table_name", Schema}, repo: @repo)

But when supplying params for all/3 or find/3, an ArgumentError is raised:

EctoShorts.Actions.all({"table_name", Schema}, %{key: value}, repo: @repo)
** (ArgumentError) you attempted to apply a function on {"table_name", Schema}. Modules (the first argument of apply) must always be an atom
    :erlang.apply({"table_name", Schema}, :__schema__, [:query_fields])
    (ecto_shorts 2.4.0) lib/query_builder/schema.ex:27: EctoShorts.QueryBuilder.Schema.create_schema_filter/3
    (elixir 1.14.2) lib/enum.ex:2468: Enum."-reduce/3-lists^foldl/2-0-"/3
    (ecto_shorts 2.4.0) lib/actions.ex:143: EctoShorts.Actions.all/3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant