Enhance executemany() to use multistatement - #798
Open
methane wants to merge 9 commits into
Open
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #798 +/- ##
==========================================
+ Coverage 88.86% 91.72% +2.86%
==========================================
Files 7 7
Lines 548 665 +117
==========================================
+ Hits 487 610 +123
+ Misses 61 55 -6 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request introduces a new
executemany_fallbackoption to improve howexecutemany()handles non-bulk DML statements, allowing for client-side multi-statement batching. It also adds a newmore_results()method to the connection API, enhances documentation, and expands test coverage for these features.Enhancements to executemany() batching and options:
executemany_fallbackoption to theConnectionandCursorclasses, allowing users to control whether non-bulk DML statements inexecutemany()are executed in a loop (default) or batched into multi-statement queries ("multi"). This includes validation, documentation, and support for configuration via connection parameters. [1] [2] [3] [4] [5] [6] [7] [8]Cursor.executemany()for the"multi"fallback, including statement batching, error handling, and result validation.API improvements:
more_results()method to the connection object, allowing users to check for additional results after a multi-statement query, and documented its usage. [1] [2] [3]Documentation updates:
executemany_fallbackoption, its configuration, and the behavior ofexecutemany()with batching. [1] [2]more_results()method in the user guide and API reference.Testing improvements:
executemany_fallbackoption, including validation of connection and subclass defaults, and extended multi-statement tests to cover the new API. [1] [2] [3] [4] [5] [6]Regular expression and utility enhancements:
cursors.py. [1] [2]These changes provide more flexible and performant handling of bulk and non-bulk DML operations, better error handling, and improved developer experience through new APIs and documentation.