-
Notifications
You must be signed in to change notification settings - Fork 37
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
Positional parameters #8
Comments
@IvanIvanoff could you provide a code example for ecto query with multiple params with the same |
@scarfacedeb For one of my use cases I'm writing plain sql and execute it with
Without positional params I have to pass 11 arguments instead of 5. |
@IvanIvanoff I could see how positional params can be useful here. But I think that The actual substitution of Therefore modifying @santaux what do you think? |
On second thought, Therefore any params-related features will be implemented in the On the one hand, It gives certain flexibility to the implementation. On the other hand, it means extra support for that feature. In contrast to I guess only the maintainer can tell if it's worth pursuing. |
@scarfacedeb I'm still not convinced where it should be handled. Are you aware of any such situation in other adapters and how they handle it? Edit: Yeah, you managed to post the same thoughts just a second before me. |
yep, that's exactly what I was thinking in the message above :)
As far as my understanding goes, postgrex supports positional params, because postgres itself supports them (see: https://github.com/elixir-ecto/postgrex/blob/43aa6b964043dd8726dba363245aebd3734bde47/lib/postgrex/messages.ex#L289)
|
I think that you were right when said that clickhouse itself doesn't support any placeholder params at all. And also, as @IvanIvanoff said:
🤔 |
@santaux I had more time to think about it, and I'm certain now that it's better to keep things as simple as possible in the adapter. Positional parameters is a nice-to-have feature, but it should be supported by clickhouse itself. Faking it in the adapter creates the unwanted discrepancy between db implementation, api of other clients (e.g. in other languages) and the current client's api. |
My use case is that I use the elixir client with a read-only CH user that caches the result, so here I would trade some performance for cleaner code.
I see that you removed the
?<number>
in #7My queries require a lot of repeating parameters, so I forked the repo and fixed some issues santiment#1.
Are you planing to go forward without supporting positional parameters at all? Or maybe implement both? In case you are interested I would try to find some free time to work in that direction and try to improve the performance as well.
The text was updated successfully, but these errors were encountered: