-
Notifications
You must be signed in to change notification settings - Fork 21.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Change execute_batch to take array of statements
Adapters don't necessarily have the ability to execute a batch of statements. Previously execute_batch took a single string of statements separated by ';', this meant that the adapter had to have the ability to execute batch statements. Instead, this commit changes the method to take an array of statements. Adapters which support batched queries can do the join there. For adapters which don't we provide a fallback implementation: executing each statement one at a time. This also improves the implementation for the mysql2 adapter, which understands that there is a maximium query length. Previously the caller needed to split the statements before passing them to execute_batch, now execute_batch itself is responsible for splitting the queries.
- Loading branch information
Showing
4 changed files
with
31 additions
and
32 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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