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

multi query and BinaryProtocol #293

Open
zirill opened this issue Mar 9, 2024 · 2 comments
Open

multi query and BinaryProtocol #293

zirill opened this issue Mar 9, 2024 · 2 comments

Comments

@zirill
Copy link

zirill commented Mar 9, 2024

HI

Is it possible?

  1. query_iter and return BinaryProtocol

or

  1. exec_iter and muti query - select 1;select 2;
@blackbeam
Copy link
Owner

As far as I can tell the closest thing is CLIENT_MULTI_STATEMENTS capability and actually it is enabled by the driver (see here).

This means that if it is enabled on the server side, then you can try to prepare multiple SQL statements using single prepare and try to execute the resulting prepared statement — results should be in binary protocol. Please note that I never tried this so please report in case of issues.

@zirill
Copy link
Author

zirill commented Mar 25, 2024

Thanks for the tip, but so far no results.

I'm using mariadb, searched, can't find anywhere how to enable it on the server side.

Everywhere it is specified as a flag on connection.

result = conn.exec_iter("select 1; select 2;", Params::Empty).await?;

ServerError { code: 1064, message: "You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'select 2' at line 1", state: "42000" }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants