SNOW-199087: Implement multi-statement support for the Python connector.
SNOW-676491: Executing multiple queries with no complications.
SNOW-676495: Execute multiple queries with parameter bindings.
-
What GitHub issue is this PR addressing? Make sure that there is an accompanying issue to your PR.
Fixes SNOW-199087
-
Fill out the following pre-review checklist:
- [x] I am adding a new automated test(s) to verify correctness of my new code
- [ ] I am adding new logging messages
- [ ] I am adding a new telemetry message
- [ ] I am modifying authorization mechanisms
- [ ] I am adding new credentials
- [ ] I am modifying OCSP code
- [ ] I am adding a new dependency
-
Please describe how your code solves the related issue.
When submitting a multi-statement query, GS returns a payload in which
resultIdscorresponding to each of the individual queries are provided. Even if the parameter (account, session, or statement level)MULTI_STATEMENT_COUNTis not 1 (other options allow multi-statement results), GS will still return the regular payload withoutresultIds, allowing the connector to determine whether the query submitted was multi-statement or not after inspecting the payload. I added several data members to thecursorclass allowing the storage and retrieval of submitted query IDs. Theexec_asyncfunctionality will also work the same way as it does for single statements (users are expected to callget_results_by_sfqidwhen they want to retrieve results of an asynchronous multi-statement query. Using the stored query IDs and thequery_resultmethod, the connector can set the cursor to achieve the same ready state for callingfetch*()after callingnextset()to iterate through the result sets of each query in the submitted multi-statement.