-
Notifications
You must be signed in to change notification settings - Fork 10
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
Array support #7
Comments
Hi @thure Thanks for the report, I didn't know about this problem.
Can you show me an example query with this issue?
I'm still not sure what needs to be done but PRs are welcome :) |
If I use code like this: lqueries = ["some.path", "other.path"]
from(
bt in BallotTree,
where: fragment("? \\? ?", bt.path, ^lqueries),
select: sum(bt.vote_power)
)
|> Repo.all() It gets translated to this SQL: SELECT sum(c0."vote_power") FROM "cached_stv_scott_ballot_trees" AS c0 WHERE (c0."path" ? $2) [["some.path", "other.path"]] But it errors with:
…which seems like it knows that this is an array of the correct type, given Postgres prepends a type with an underscore in those cases, it just doesn't handle encoding/decoding arrays of these types. Has EctoLtree been tested with ltree array opererators like |
I've been digging into this issue and I think it's not going to be possible. I'm fairly certain, it will need an upstream addition to postgrex to fix the |
Hello, may i know if this issue is fixable w a PR as above? Many thanks |
I've appreciated this library a ton.
Seems however that it's missing or now needs to implement array support for
lquery
and possiblyltree
in order to support operations that take arrays as arguments: elixir-ecto/postgrex#528.I'd be willlilng to help, but I'm totally unfamiliar with how Postgres communicates with Ecto. Is there a model for encoding/decoding arrays of this type I could use to create a PR, if one would be welcome?
The text was updated successfully, but these errors were encountered: