mysql_async
mysql_async copied to clipboard
multi query and BinaryProtocol
HI
Is it possible?
- query_iter and return BinaryProtocol
or
- exec_iter and muti query - select 1;select 2;
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.
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" }