The QueryAs::fetch method from sqlx calls Executor::fetch_many underneath, so this change cannot be done now. A test was implemented to check against this.
When this test starts failing, check again whether the Executor::fetch_many can be made to fail on multi-statement queries that have arguments or are meant to be prepared.
If all looks good, then Executor::fetch_many can be made to exclusively call ExecuteBatch and possibly error out when it would otherwise prepare a statement or bind arguments.
The
QueryAs::fetchmethod fromsqlxcallsExecutor::fetch_manyunderneath, so this change cannot be done now. A test was implemented to check against this.When this test starts failing, check again whether the
Executor::fetch_manycan be made to fail on multi-statement queries that have arguments or are meant to be prepared.If all looks good, then
Executor::fetch_manycan be made to exclusively callExecuteBatchand possibly error out when it would otherwise prepare a statement or bind arguments.