1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00
rails--rails/activerecord/lib/active_record
John Hawthorn 22513cfba5 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.
2019-11-17 20:16:06 -08:00
..
associations :polymorphic, :as, and :foreign_type are valid for polymorphic association 2019-11-10 10:54:58 +09:00
attribute_methods Fix keyword arguments warnings 2019-09-13 10:03:48 +09:00
coders Enable Layout/EmptyLinesAroundAccessModifier cop 2019-06-13 12:00:45 +09:00
connection_adapters Change execute_batch to take array of statements 2019-11-17 20:16:06 -08:00
database_configurations Merge ConnectionSpecification + Role -> Role 2019-10-18 10:26:08 -05:00
fixture_set Fix an error message to replace http with https in a reference URL 2019-09-02 10:02:29 +09:00
locale
locking Update MySQL links to the current version of the manual [ci skip] 2019-10-03 20:22:29 -04:00
middleware Call while_preventing_writes from connected_to 2019-08-28 13:44:51 -04:00
migration Unify create_table method signature to take keyword arguments 2019-09-15 03:05:52 +09:00
railties Reestablish connection to previous database after migrating: 2019-10-30 19:31:22 +01:00
relation Additionally order by primary key if implicit_order_column is not uniq 2019-11-03 16:01:18 +01:00
scoping Improve deprecation message for leaking scope 2019-11-15 18:26:19 +09:00
tasks Remove ConnectionAdapters::Resolver in favor of DatabaseConfigurations 2019-11-12 22:30:31 -08:00
type Registration#matches? takes keyword arguments 2019-09-07 11:51:20 +09:00
type_caster Fall back to type casting from the connection adapter 2019-05-21 23:41:13 +09:00
validations Fix keyword arguments warnings 2019-09-11 10:48:29 +09:00
aggregations.rb Fix docs to replace http with https in activerecord [ci skip] 2019-08-26 22:34:33 +09:00
association_relation.rb Refactor association.scoping not to rely on klass.all 2019-10-22 00:06:31 +09:00
associations.rb Do not refer internal constant in the doc [ci skip] 2019-10-13 21:28:44 +09:00
attribute_assignment.rb Enable Layout/EmptyLinesAroundAccessModifier cop 2019-06-13 12:00:45 +09:00
attribute_decorators.rb Enable Layout/EmptyLinesAroundAccessModifier cop 2019-06-13 12:00:45 +09:00
attribute_methods.rb Simplify class_method_defined_within 2019-10-21 15:22:41 +09:00
attributes.rb Enable Layout/EmptyLinesAroundAccessModifier cop 2019-06-13 12:00:45 +09:00
autosave_association.rb Merge pull request #37094 from p8/fix-autosave-comment 2019-10-07 09:28:09 -04:00
base.rb Remove unused requires 2019-10-29 21:52:27 -04:00
callbacks.rb Unify AR touch method signatures 2019-09-06 18:52:00 +09:00
connection_adapters.rb Remove Resolver autoload 2019-11-13 15:28:50 -08:00
connection_handling.rb Remove ConnectionAdapters::Resolver in favor of DatabaseConfigurations 2019-11-12 22:30:31 -08:00
core.rb Make has_many inversing opt-in 2019-10-11 15:55:46 -04:00
counter_cache.rb Remove force parent loading when counter cache child is created/destroyed 2018-09-26 23:45:08 +09:00
database_configurations.rb Remove ConnectionAdapters::Resolver in favor of DatabaseConfigurations 2019-11-12 22:30:31 -08:00
define_callbacks.rb
dynamic_matchers.rb Enable Layout/EmptyLinesAroundAccessModifier cop 2019-06-13 12:00:45 +09:00
enum.rb Add docs about _scopes option on enum. [ci skip] 2019-10-02 08:54:26 -03:00
errors.rb Update MySQL links to the current version of the manual [ci skip] 2019-10-03 20:22:29 -04:00
explain.rb Enable Layout/EmptyLinesAroundAccessModifier cop 2019-06-13 12:00:45 +09:00
explain_registry.rb
explain_subscriber.rb Use match? where we don't need MatchData 2019-07-27 13:06:49 +09:00
fixtures.rb Stop autoloading AbstractAdapter prematurely 2019-09-13 01:10:14 +01:00
gem_version.rb Start Rails 6.1 development 2019-04-24 15:57:14 -04:00
inheritance.rb Add methods to the public API of ActiveRecord::Inheritance 2019-10-17 16:56:07 -04:00
insert_all.rb Clear query cache when insert all is used 2019-09-09 00:55:16 +01:00
integration.rb Remove wrong default value for cache_versioning in documentation of cache_version 2019-05-29 11:47:45 +02:00
internal_metadata.rb t.string takes keyword arguments 2019-09-24 13:48:14 +09:00
legacy_yaml_adapter.rb
log_subscriber.rb Reduce object allocations during activerecord.sql logging 2019-08-18 23:58:13 +09:00
migration.rb Use FileUpdateChecker for Migration::CheckPending 2019-10-08 16:29:12 -07:00
model_schema.rb Address all possible Performance/StartWith / Performance/EndWith violations 2019-11-14 03:20:29 +09:00
nested_attributes.rb [ci skip] switch eg. to proper e.g. 2019-10-07 02:18:36 +02:00
no_touching.rb Unify AR touch method signatures 2019-09-06 18:52:00 +09:00
null_relation.rb Enable Layout/EmptyLinesAroundAccessModifier cop 2019-06-13 12:00:45 +09:00
persistence.rb Add two cross links to methods in docs [skip ci] 2019-10-15 22:31:24 +10:00
query_cache.rb Reduce Array allocations 2019-07-31 17:41:34 +09:00
querying.rb Add missing touch_all delegation to relation 2019-04-05 16:13:40 +09:00
railtie.rb Make has_many inversing opt-in 2019-10-11 15:55:46 -04:00
readonly_attributes.rb Extract readonly_attribute? 2019-05-27 06:41:31 +09:00
reflection.rb Fix has_one through reflection casting check 2019-09-13 13:07:01 -04:00
relation.rb Avoid making query when using where(attr: []) 2019-09-30 16:37:07 -07:00
result.rb Enable Layout/EmptyLinesAroundAccessModifier cop 2019-06-13 12:00:45 +09:00
runtime_registry.rb
sanitization.rb [ci skip] switch eg. to proper e.g. 2019-10-07 02:18:36 +02:00
schema.rb Move SchemaMigration to migration_context 2019-06-14 11:15:08 -04:00
schema_dumper.rb MySQL: Fix schema dumping enum and set columns correctly 2019-07-05 18:42:41 +09:00
schema_migration.rb Fix keyword arguments warnings 2019-09-09 22:49:09 +09:00
scoping.rb Enable Layout/EmptyLinesAroundAccessModifier cop 2019-06-13 12:00:45 +09:00
secure_token.rb Set default of 28 characters in ActiveStorage::Blob.generate_unique_secure_token 2019-04-09 19:45:26 -04:00
serialization.rb Use try only when we're unsure if the receiver would respond_to the method 2019-08-01 17:58:00 +09:00
statement_cache.rb Ruby 2.7 warning: creating a Proc without a block 2019-02-13 02:11:21 +01:00
store.rb [ci skip] switch eg. to proper e.g. 2019-10-07 02:18:36 +02:00
suppressor.rb AR save takes keyword arguments 2019-09-06 18:52:00 +09:00
table_metadata.rb Fall back to type casting from the connection adapter 2019-05-21 23:41:13 +09:00
test_databases.rb Make DatabaseTasks use DatabaseConfig objects 2019-09-18 15:50:05 -04:00
test_fixtures.rb Rename the classes 2019-11-06 19:08:47 -05:00
timestamp.rb Enable Layout/EmptyLinesAroundAccessModifier cop 2019-06-13 12:00:45 +09:00
touch_later.rb Enable Layout/EmptyLinesAroundAccessModifier cop 2019-06-13 12:00:45 +09:00
transactions.rb Update MySQL links to the current version of the manual [ci skip] 2019-10-03 20:22:29 -04:00
translation.rb Add AR::Base.base_class? predicate 2018-04-02 14:34:32 +03:00
type.rb Enable Layout/EmptyLinesAroundAccessModifier cop 2019-06-13 12:00:45 +09:00
type_caster.rb
validations.rb Unify save method signatures to take keyword arguments 2019-09-04 13:47:02 +09:00
version.rb