elixir-ecto / myxql

MySQL 5.5+ driver for Elixir
Apache License 2.0
273 stars 67 forks source link

Client-side prepared statements #150

Closed heri16 closed 2 years ago

heri16 commented 2 years ago

Are client-side prepared statements supported?

https://docs.singlestore.com/managed-service/en/developer-resources/connect-with-application-development-tools/using-prepared-statements.html

If yes, how can it be enabled? If no, what would be a good approach for a PR be like?

josevalim commented 2 years ago

This is the equivalent of using the :text encoding for queries but we don't have emulation. Emulating would be possible if implemented but I am a bit skeptical because parameters help everyone avoid SQL injection attacks, so it seems to be troublesome to disable this for performance(?) reasons.

heri16 commented 2 years ago

Is there an option to turn off binary protocol globally or change the default of query_type: :binary?

https://docs.singlestore.com/managed-service/en/connect-to-your-cluster/connect-with-mysql/connect-with-any-mysql-compatible-tool-to-singlestore.html

wojtekmach commented 2 years ago

As mentioned above you can use the text protocol with that option. There is no global option that would make all queries use text by default.