active_record_shards 3.17.0 → 4.0.0.beta1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +5 -5
- data/README.md +50 -115
- data/lib/active_record_shards.rb +2 -14
- data/lib/active_record_shards/association_collection_connection_selection.rb +1 -2
- data/lib/active_record_shards/configuration_parser.rb +1 -2
- data/lib/active_record_shards/connection_switcher-5-0.rb +0 -10
- data/lib/active_record_shards/connection_switcher-5-1.rb +0 -10
- data/lib/active_record_shards/connection_switcher.rb +37 -51
- data/lib/active_record_shards/default_slave_patches.rb +36 -44
- data/lib/active_record_shards/model.rb +5 -20
- data/lib/active_record_shards/shard_selection.rb +21 -58
- data/lib/active_record_shards/shard_support.rb +0 -1
- data/lib/active_record_shards/sharded_model.rb +15 -0
- data/lib/active_record_shards/sql_comments.rb +1 -5
- data/lib/active_record_shards/tasks.rb +19 -38
- metadata +52 -87
- data/lib/active_record_shards/connection_handler.rb +0 -8
- data/lib/active_record_shards/connection_pool.rb +0 -36
- data/lib/active_record_shards/connection_specification.rb +0 -19
- data/lib/active_record_shards/connection_switcher-4-2.rb +0 -56
- data/lib/active_record_shards/migration.rb +0 -125
- data/lib/active_record_shards/patches-4-2.rb +0 -9
- data/lib/active_record_shards/schema_dumper_extension.rb +0 -42
@@ -1,8 +1,7 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
|
-
|
3
2
|
module ActiveRecordShards
|
4
3
|
module DefaultSlavePatches
|
5
|
-
def self.wrap_method_in_on_slave(class_method, base, method
|
4
|
+
def self.wrap_method_in_on_slave(class_method, base, method)
|
6
5
|
base_methods =
|
7
6
|
if class_method
|
8
7
|
base.methods + base.private_methods
|
@@ -11,14 +10,11 @@ module ActiveRecordShards
|
|
11
10
|
end
|
12
11
|
|
13
12
|
return unless base_methods.include?(method)
|
14
|
-
|
15
13
|
_, method, punctuation = method.to_s.match(/^(.*?)([\?\!]?)$/).to_a
|
16
|
-
# _ALWAYS_ on slave, or only for on `on_slave_by_default = true` models?
|
17
|
-
wrapper = force_on_slave ? 'force_on_slave' : 'on_slave_unless_tx'
|
18
14
|
base.class_eval <<-RUBY, __FILE__, __LINE__ + 1
|
19
15
|
#{class_method ? 'class << self' : ''}
|
20
16
|
def #{method}_with_default_slave#{punctuation}(*args, &block)
|
21
|
-
|
17
|
+
on_slave_unless_tx do
|
22
18
|
#{method}_without_default_slave#{punctuation}(*args, &block)
|
23
19
|
end
|
24
20
|
end
|
@@ -29,6 +25,18 @@ module ActiveRecordShards
|
|
29
25
|
RUBY
|
30
26
|
end
|
31
27
|
|
28
|
+
def columns_with_force_slave(*args, &block)
|
29
|
+
on_cx_switch_block(:slave, construct_ro_scope: false, force: true) do
|
30
|
+
columns_without_force_slave(*args, &block)
|
31
|
+
end
|
32
|
+
end
|
33
|
+
|
34
|
+
def table_exists_with_force_slave?(*args, &block)
|
35
|
+
on_cx_switch_block(:slave, construct_ro_scope: false, force: true) do
|
36
|
+
table_exists_without_force_slave?(*args, &block)
|
37
|
+
end
|
38
|
+
end
|
39
|
+
|
32
40
|
def transaction_with_slave_off(*args, &block)
|
33
41
|
if on_slave_by_default?
|
34
42
|
begin
|
@@ -48,35 +56,30 @@ module ActiveRecordShards
|
|
48
56
|
def quote_value(*args, &block)
|
49
57
|
self.class.quote_value(*args, &block)
|
50
58
|
end
|
59
|
+
|
60
|
+
def reload_with_slave_off(*args, &block)
|
61
|
+
self.class.on_master { reload_without_slave_off(*args, &block) }
|
62
|
+
end
|
51
63
|
end
|
52
64
|
|
53
|
-
CLASS_SLAVE_METHODS = [
|
54
|
-
:calculate,
|
55
|
-
:count_by_sql,
|
56
|
-
:exists?,
|
57
|
-
:find_by_sql,
|
58
|
-
:find_every,
|
59
|
-
:find_one,
|
60
|
-
:find_some
|
61
|
-
].freeze
|
62
|
-
|
63
|
-
CLASS_FORCE_SLAVE_METHODS = [
|
64
|
-
:columns,
|
65
|
-
:replace_bind_variable,
|
66
|
-
:replace_bind_variables,
|
67
|
-
:sanitize_sql_array,
|
68
|
-
:sanitize_sql_hash_for_assignment,
|
69
|
-
:table_exists?
|
70
|
-
].freeze
|
65
|
+
CLASS_SLAVE_METHODS = [:find_by_sql, :count_by_sql, :calculate, :find_one, :find_some, :find_every, :exists?].freeze
|
71
66
|
|
72
67
|
def self.extended(base)
|
73
68
|
CLASS_SLAVE_METHODS.each { |m| ActiveRecordShards::DefaultSlavePatches.wrap_method_in_on_slave(true, base, m) }
|
74
|
-
CLASS_FORCE_SLAVE_METHODS.each { |m| ActiveRecordShards::DefaultSlavePatches.wrap_method_in_on_slave(true, base, m, force_on_slave: true) }
|
75
69
|
|
76
70
|
base.class_eval do
|
77
71
|
include InstanceMethods
|
78
72
|
|
73
|
+
alias_method :reload_without_slave_off, :reload
|
74
|
+
alias_method :reload, :reload_with_slave_off
|
75
|
+
|
79
76
|
class << self
|
77
|
+
alias_method :columns_without_force_slave, :columns
|
78
|
+
alias_method :columns, :columns_with_force_slave
|
79
|
+
|
80
|
+
alias_method :table_exists_without_force_slave?, :table_exists?
|
81
|
+
alias_method :table_exists?, :table_exists_with_force_slave?
|
82
|
+
|
80
83
|
alias_method :transaction_without_slave_off, :transaction
|
81
84
|
alias_method :transaction, :transaction_with_slave_off
|
82
85
|
end
|
@@ -87,41 +90,30 @@ module ActiveRecordShards
|
|
87
90
|
end
|
88
91
|
end
|
89
92
|
|
90
|
-
def on_slave_unless_tx
|
93
|
+
def on_slave_unless_tx
|
91
94
|
if on_slave_by_default? && !Thread.current[:_active_record_shards_slave_off]
|
92
|
-
on_slave
|
95
|
+
on_slave { yield }
|
93
96
|
else
|
94
97
|
yield
|
95
98
|
end
|
96
99
|
end
|
97
100
|
|
98
|
-
def force_on_slave(&block)
|
99
|
-
on_cx_switch_block(:slave, construct_ro_scope: false, force: true, &block)
|
100
|
-
end
|
101
|
-
|
102
101
|
module ActiveRelationPatches
|
103
102
|
def self.included(base)
|
104
|
-
[:calculate, :exists?, :pluck, :
|
103
|
+
[:calculate, :exists?, :pluck, :find_with_associations].each do |m|
|
105
104
|
ActiveRecordShards::DefaultSlavePatches.wrap_method_in_on_slave(false, base, m)
|
106
105
|
end
|
107
|
-
|
108
|
-
if ActiveRecord::VERSION::MAJOR == 4
|
109
|
-
# `where` and `having` clauses call `create_binds`, which will use the master connection
|
110
|
-
ActiveRecordShards::DefaultSlavePatches.wrap_method_in_on_slave(false, base, :create_binds, force_on_slave: true)
|
111
|
-
end
|
112
|
-
|
113
|
-
ActiveRecordShards::DefaultSlavePatches.wrap_method_in_on_slave(false, base, :to_sql, force_on_slave: true)
|
114
106
|
end
|
115
107
|
|
116
|
-
def on_slave_unless_tx
|
117
|
-
@klass.on_slave_unless_tx
|
108
|
+
def on_slave_unless_tx
|
109
|
+
@klass.on_slave_unless_tx { yield }
|
118
110
|
end
|
119
111
|
end
|
120
112
|
|
121
113
|
# in rails 4.1+, they create a join class that's used to pull in records for HABTM.
|
122
114
|
# this simplifies the hell out of our existence, because all we have to do is inerit on-slave-by-default
|
123
115
|
# down from the parent now.
|
124
|
-
module
|
116
|
+
module HasAndBelongsToManyBuilderExtension
|
125
117
|
def self.included(base)
|
126
118
|
base.class_eval do
|
127
119
|
alias_method :through_model_without_inherit_default_slave_from_lhs, :through_model
|
@@ -135,8 +127,8 @@ module ActiveRecordShards
|
|
135
127
|
left_reflection.klass.on_slave_by_default?
|
136
128
|
end
|
137
129
|
|
138
|
-
|
139
|
-
|
130
|
+
model.extend(ActiveRecordShards::Ext::ShardedModel) if model.left_reflection.klass.is_sharded?
|
131
|
+
|
140
132
|
model
|
141
133
|
end
|
142
134
|
end
|
@@ -3,25 +3,14 @@
|
|
3
3
|
module ActiveRecordShards
|
4
4
|
module Model
|
5
5
|
def not_sharded
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
self.sharded = false
|
6
|
+
ActiveSupport::Deprecation.warn("Calling not_sharded is deprecated. "\
|
7
|
+
"Please ensure to still read from the "\
|
8
|
+
"account db slave after removing the "\
|
9
|
+
"call.")
|
11
10
|
end
|
12
11
|
|
13
12
|
def is_sharded? # rubocop:disable Naming/PredicateName
|
14
|
-
|
15
|
-
sharded != false && supports_sharding?
|
16
|
-
elsif self == base_class
|
17
|
-
if sharded.nil?
|
18
|
-
ActiveRecord::Base.is_sharded?
|
19
|
-
else
|
20
|
-
sharded != false
|
21
|
-
end
|
22
|
-
else
|
23
|
-
base_class.is_sharded?
|
24
|
-
end
|
13
|
+
false
|
25
14
|
end
|
26
15
|
|
27
16
|
def on_slave_by_default?
|
@@ -62,9 +51,5 @@ module ActiveRecordShards
|
|
62
51
|
base.send(:include, InstanceMethods)
|
63
52
|
base.after_initialize :initialize_shard_and_slave
|
64
53
|
end
|
65
|
-
|
66
|
-
private
|
67
|
-
|
68
|
-
attr_accessor :sharded
|
69
54
|
end
|
70
55
|
end
|
@@ -1,77 +1,40 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
|
-
|
3
2
|
module ActiveRecordShards
|
4
3
|
class ShardSelection
|
5
|
-
|
6
|
-
cattr_accessor :default_shard
|
7
|
-
|
8
|
-
def initialize
|
4
|
+
def initialize(shard)
|
9
5
|
@on_slave = false
|
10
|
-
|
6
|
+
self.shard = shard
|
11
7
|
end
|
12
8
|
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
if @shard == NO_SHARD
|
18
|
-
nil
|
19
|
-
else
|
20
|
-
@shard || self.class.default_shard
|
21
|
-
end
|
22
|
-
end
|
23
|
-
end
|
24
|
-
|
25
|
-
def shard_name(klass = nil, try_slave = true)
|
26
|
-
the_shard = shard(klass)
|
27
|
-
|
28
|
-
@shard_names ||= {}
|
29
|
-
@shard_names[ActiveRecordShards.rails_env] ||= {}
|
30
|
-
@shard_names[ActiveRecordShards.rails_env][the_shard] ||= {}
|
31
|
-
@shard_names[ActiveRecordShards.rails_env][the_shard][try_slave] ||= {}
|
32
|
-
@shard_names[ActiveRecordShards.rails_env][the_shard][try_slave][@on_slave] ||= begin
|
33
|
-
s = ActiveRecordShards.rails_env.dup
|
34
|
-
s << "_shard_#{the_shard}" if the_shard
|
35
|
-
s << "_slave" if @on_slave && try_slave
|
36
|
-
s
|
37
|
-
end
|
38
|
-
end
|
9
|
+
def shard
|
10
|
+
raise "Missing shard information on connection" unless @shard
|
11
|
+
@shard
|
12
|
+
end
|
39
13
|
|
40
|
-
|
14
|
+
PRIMARY = "primary".freeze
|
15
|
+
def resolve_connection_name(sharded:, configurations:)
|
16
|
+
resolved_shard = sharded ? shard : nil
|
41
17
|
|
42
|
-
|
43
|
-
|
44
|
-
nil
|
45
|
-
else
|
46
|
-
@shard || self.class.default_shard
|
47
|
-
end
|
18
|
+
if !resolved_shard && !@on_slave
|
19
|
+
return PRIMARY
|
48
20
|
end
|
49
21
|
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
22
|
+
@shard_names ||= {}
|
23
|
+
@shard_names[ActiveRecordShards.rails_env] ||= {}
|
24
|
+
@shard_names[ActiveRecordShards.rails_env][resolved_shard] ||= {}
|
25
|
+
@shard_names[ActiveRecordShards.rails_env][resolved_shard][@on_slave] ||= begin
|
26
|
+
s = ActiveRecordShards.rails_env.dup
|
27
|
+
s << "_shard_#{resolved_shard}" if resolved_shard
|
54
28
|
|
55
|
-
@
|
56
|
-
|
57
|
-
@connection_names[env][resolved_shard] ||= {}
|
58
|
-
@connection_names[env][resolved_shard][@on_slave] ||= begin
|
59
|
-
name = env.dup
|
60
|
-
name << "_shard_#{resolved_shard}" if resolved_shard
|
61
|
-
if @on_slave && configurations["#{name}_slave"]
|
62
|
-
"#{name}_slave"
|
63
|
-
else
|
64
|
-
# ActiveRecord always names its default connection pool 'primary'
|
65
|
-
# while everything else is named by the configuration name
|
66
|
-
resolved_shard ? name : PRIMARY
|
67
|
-
end
|
29
|
+
if @on_slave && configurations["#{s}_slave"] # fall back to master connection
|
30
|
+
s << "_slave"
|
68
31
|
end
|
32
|
+
s
|
69
33
|
end
|
70
|
-
|
71
34
|
end
|
72
35
|
|
73
36
|
def shard=(new_shard)
|
74
|
-
@shard = (new_shard
|
37
|
+
@shard = Integer(new_shard)
|
75
38
|
end
|
76
39
|
|
77
40
|
def on_slave?
|
@@ -0,0 +1,15 @@
|
|
1
|
+
module ActiveRecordShards
|
2
|
+
module Ext
|
3
|
+
module ShardedModel
|
4
|
+
def is_sharded? # rubocop:disable Naming/PredicateName
|
5
|
+
true
|
6
|
+
end
|
7
|
+
end
|
8
|
+
end
|
9
|
+
|
10
|
+
class ShardedModel < ActiveRecord::Base
|
11
|
+
self.abstract_class = true
|
12
|
+
|
13
|
+
extend ActiveRecordShards::Ext::ShardedModel
|
14
|
+
end
|
15
|
+
end
|
@@ -10,11 +10,7 @@ module ActiveRecordShards
|
|
10
10
|
end
|
11
11
|
|
12
12
|
def self.enable
|
13
|
-
ActiveRecord::Base.
|
14
|
-
ActiveRecord::Base.on_shard(nil) do
|
15
|
-
ActiveRecord::Base.connection.class.prepend(Methods)
|
16
|
-
end
|
17
|
-
end
|
13
|
+
ActiveRecord::Base.connection.class.prepend(Methods)
|
18
14
|
end
|
19
15
|
end
|
20
16
|
end
|
@@ -1,5 +1,4 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
|
-
|
3
2
|
require 'active_record_shards'
|
4
3
|
|
5
4
|
%w[db:drop db:create db:abort_if_pending_migrations db:reset db:test:purge].each do |name|
|
@@ -9,16 +8,15 @@ end
|
|
9
8
|
namespace :db do
|
10
9
|
desc 'Drops the database for the current RAILS_ENV including shards'
|
11
10
|
task drop: :load_config do
|
12
|
-
ActiveRecord::Base.configurations.
|
11
|
+
ActiveRecord::Base.configurations.each do |key, conf|
|
13
12
|
next if !key.starts_with?(ActiveRecordShards.rails_env) || key.ends_with?("_slave")
|
14
|
-
|
15
13
|
begin
|
16
14
|
ActiveRecordShards::Tasks.root_connection(conf).drop_database(conf['database'])
|
17
15
|
# rescue ActiveRecord::NoDatabaseError # TODO: exists in AR but never is raised here ...
|
18
16
|
# $stderr.puts "Database '#{conf['database']}' does not exist"
|
19
|
-
rescue StandardError =>
|
20
|
-
|
21
|
-
|
17
|
+
rescue StandardError => error
|
18
|
+
$stderr.puts error, *error.backtrace
|
19
|
+
$stderr.puts "Couldn't drop #{conf['database']}"
|
22
20
|
end
|
23
21
|
end
|
24
22
|
end
|
@@ -30,21 +28,20 @@ namespace :db do
|
|
30
28
|
|
31
29
|
desc "Create the database defined in config/database.yml for the current RAILS_ENV including shards"
|
32
30
|
task create: :load_config do
|
33
|
-
ActiveRecord::Base.configurations.
|
31
|
+
ActiveRecord::Base.configurations.each do |key, conf|
|
34
32
|
next if !key.starts_with?(ActiveRecordShards.rails_env) || key.ends_with?("_slave")
|
35
|
-
|
36
33
|
begin
|
37
|
-
# MysqlAdapter takes charset instead of encoding in Rails 4
|
38
|
-
# https://github.com/rails/rails/
|
34
|
+
# MysqlAdapter takes charset instead of encoding in Rails 4
|
35
|
+
# https://github.com/rails/rails/commit/78b30fed9336336694fb2cb5d2825f95800b541c
|
39
36
|
symbolized_configuration = conf.symbolize_keys
|
40
37
|
symbolized_configuration[:charset] = symbolized_configuration[:encoding]
|
41
38
|
|
42
39
|
ActiveRecordShards::Tasks.root_connection(conf).create_database(conf['database'], symbolized_configuration)
|
43
|
-
rescue ActiveRecord::StatementInvalid =>
|
44
|
-
if
|
40
|
+
rescue ActiveRecord::StatementInvalid => ex
|
41
|
+
if ex.message.include?('database exists')
|
45
42
|
puts "#{conf['database']} already exists"
|
46
43
|
else
|
47
|
-
raise
|
44
|
+
raise ex
|
48
45
|
end
|
49
46
|
end
|
50
47
|
end
|
@@ -55,20 +52,12 @@ namespace :db do
|
|
55
52
|
task abort_if_pending_migrations: :environment do
|
56
53
|
if defined? ActiveRecord
|
57
54
|
pending_migrations =
|
58
|
-
|
59
|
-
migrations = ActiveRecord::MigrationContext.new(ActiveRecord::Migrator.migrations_paths, ActiveRecord::SchemaMigration).migrations
|
60
|
-
ActiveRecord::Migrator.new(:up, migrations, ActiveRecord::SchemaMigration).pending_migrations
|
61
|
-
elsif ActiveRecord::VERSION::STRING >= "5.2.0"
|
62
|
-
migrations = ActiveRecord::MigrationContext.new(ActiveRecord::Migrator.migrations_paths).migrations
|
63
|
-
ActiveRecord::Migrator.new(:up, migrations).pending_migrations
|
64
|
-
else
|
65
|
-
ActiveRecord::Base.on_shard(nil) { ActiveRecord::Migrator.open(ActiveRecord::Migrator.migrations_paths).pending_migrations }
|
66
|
-
end
|
55
|
+
ActiveRecord::Base.on_shard(nil) { ActiveRecord::Migrator.open(ActiveRecord::Migrator.migrations_paths).pending_migrations }
|
67
56
|
|
68
57
|
if pending_migrations.any?
|
69
|
-
|
58
|
+
puts "You have #{pending_migrations.size} pending migrations:"
|
70
59
|
pending_migrations.each do |pending_migration|
|
71
|
-
|
60
|
+
puts ' %4d %s' % [pending_migration.version, pending_migration.name]
|
72
61
|
end
|
73
62
|
abort %(Run "rake db:migrate" to update your database then try again.)
|
74
63
|
end
|
@@ -92,20 +81,12 @@ end
|
|
92
81
|
|
93
82
|
module ActiveRecordShards
|
94
83
|
module Tasks
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
end
|
102
|
-
|
103
|
-
private
|
104
|
-
|
105
|
-
def spec_for(conf)
|
106
|
-
resolver = ActiveRecord::ConnectionAdapters::ConnectionSpecification::Resolver.new(ActiveRecord::Base.configurations)
|
107
|
-
resolver.spec(conf)
|
108
|
-
end
|
84
|
+
def self.root_connection(conf)
|
85
|
+
# this will trigger rails to load the adapter
|
86
|
+
conf = conf.merge('database' => nil)
|
87
|
+
resolver = ActiveRecord::ConnectionAdapters::ConnectionSpecification::Resolver.new(ActiveRecord::Base.configurations)
|
88
|
+
resolver.spec(conf)
|
89
|
+
ActiveRecord::Base.send("#{conf['adapter']}_connection", conf)
|
109
90
|
end
|
110
91
|
end
|
111
92
|
end
|
metadata
CHANGED
@@ -1,62 +1,47 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: active_record_shards
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 4.0.0.beta1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
|
-
- Benjamin Quorning
|
8
|
-
- Gabe Martin-Dempesy
|
9
|
-
- Pierre Schambacher
|
10
7
|
- Mick Staugaard
|
11
8
|
- Eric Chapweske
|
12
9
|
- Ben Osheroff
|
13
10
|
autorequire:
|
14
11
|
bindir: bin
|
15
12
|
cert_chain: []
|
16
|
-
date:
|
13
|
+
date: 2017-10-26 00:00:00.000000000 Z
|
17
14
|
dependencies:
|
18
15
|
- !ruby/object:Gem::Dependency
|
19
16
|
name: activerecord
|
20
17
|
requirement: !ruby/object:Gem::Requirement
|
21
18
|
requirements:
|
22
|
-
- - "
|
23
|
-
- !ruby/object:Gem::Version
|
24
|
-
version: '4.2'
|
25
|
-
- - "<"
|
19
|
+
- - "~>"
|
26
20
|
- !ruby/object:Gem::Version
|
27
|
-
version: '
|
21
|
+
version: '5.0'
|
28
22
|
type: :runtime
|
29
23
|
prerelease: false
|
30
24
|
version_requirements: !ruby/object:Gem::Requirement
|
31
25
|
requirements:
|
32
|
-
- - "
|
33
|
-
- !ruby/object:Gem::Version
|
34
|
-
version: '4.2'
|
35
|
-
- - "<"
|
26
|
+
- - "~>"
|
36
27
|
- !ruby/object:Gem::Version
|
37
|
-
version: '
|
28
|
+
version: '5.0'
|
38
29
|
- !ruby/object:Gem::Dependency
|
39
30
|
name: activesupport
|
40
31
|
requirement: !ruby/object:Gem::Requirement
|
41
32
|
requirements:
|
42
|
-
- - "
|
43
|
-
- !ruby/object:Gem::Version
|
44
|
-
version: '4.2'
|
45
|
-
- - "<"
|
33
|
+
- - "~>"
|
46
34
|
- !ruby/object:Gem::Version
|
47
|
-
version: '
|
35
|
+
version: '5.0'
|
48
36
|
type: :runtime
|
49
37
|
prerelease: false
|
50
38
|
version_requirements: !ruby/object:Gem::Requirement
|
51
39
|
requirements:
|
52
|
-
- - "
|
53
|
-
- !ruby/object:Gem::Version
|
54
|
-
version: '4.2'
|
55
|
-
- - "<"
|
40
|
+
- - "~>"
|
56
41
|
- !ruby/object:Gem::Version
|
57
|
-
version: '
|
42
|
+
version: '5.0'
|
58
43
|
- !ruby/object:Gem::Dependency
|
59
|
-
name:
|
44
|
+
name: wwtd
|
60
45
|
requirement: !ruby/object:Gem::Requirement
|
61
46
|
requirements:
|
62
47
|
- - ">="
|
@@ -70,21 +55,21 @@ dependencies:
|
|
70
55
|
- !ruby/object:Gem::Version
|
71
56
|
version: '0'
|
72
57
|
- !ruby/object:Gem::Dependency
|
73
|
-
name:
|
58
|
+
name: rake
|
74
59
|
requirement: !ruby/object:Gem::Requirement
|
75
60
|
requirements:
|
76
|
-
- - "
|
61
|
+
- - "~>"
|
77
62
|
- !ruby/object:Gem::Version
|
78
|
-
version:
|
63
|
+
version: '12.0'
|
79
64
|
type: :development
|
80
65
|
prerelease: false
|
81
66
|
version_requirements: !ruby/object:Gem::Requirement
|
82
67
|
requirements:
|
83
|
-
- - "
|
68
|
+
- - "~>"
|
84
69
|
- !ruby/object:Gem::Version
|
85
|
-
version:
|
70
|
+
version: '12.0'
|
86
71
|
- !ruby/object:Gem::Dependency
|
87
|
-
name:
|
72
|
+
name: mysql2
|
88
73
|
requirement: !ruby/object:Gem::Requirement
|
89
74
|
requirements:
|
90
75
|
- - ">="
|
@@ -98,21 +83,7 @@ dependencies:
|
|
98
83
|
- !ruby/object:Gem::Version
|
99
84
|
version: '0'
|
100
85
|
- !ruby/object:Gem::Dependency
|
101
|
-
name:
|
102
|
-
requirement: !ruby/object:Gem::Requirement
|
103
|
-
requirements:
|
104
|
-
- - ">="
|
105
|
-
- !ruby/object:Gem::Version
|
106
|
-
version: 1.4.0
|
107
|
-
type: :development
|
108
|
-
prerelease: false
|
109
|
-
version_requirements: !ruby/object:Gem::Requirement
|
110
|
-
requirements:
|
111
|
-
- - ">="
|
112
|
-
- !ruby/object:Gem::Version
|
113
|
-
version: 1.4.0
|
114
|
-
- !ruby/object:Gem::Dependency
|
115
|
-
name: mysql2
|
86
|
+
name: bump
|
116
87
|
requirement: !ruby/object:Gem::Requirement
|
117
88
|
requirements:
|
118
89
|
- - ">="
|
@@ -126,81 +97,80 @@ dependencies:
|
|
126
97
|
- !ruby/object:Gem::Version
|
127
98
|
version: '0'
|
128
99
|
- !ruby/object:Gem::Dependency
|
129
|
-
name:
|
100
|
+
name: rubocop
|
130
101
|
requirement: !ruby/object:Gem::Requirement
|
131
102
|
requirements:
|
132
|
-
- -
|
103
|
+
- - '='
|
133
104
|
- !ruby/object:Gem::Version
|
134
|
-
version: 0.
|
105
|
+
version: 0.50.0
|
135
106
|
type: :development
|
136
107
|
prerelease: false
|
137
108
|
version_requirements: !ruby/object:Gem::Requirement
|
138
109
|
requirements:
|
139
|
-
- -
|
110
|
+
- - '='
|
140
111
|
- !ruby/object:Gem::Version
|
141
|
-
version: 0.
|
112
|
+
version: 0.50.0
|
142
113
|
- !ruby/object:Gem::Dependency
|
143
|
-
name:
|
114
|
+
name: minitest
|
144
115
|
requirement: !ruby/object:Gem::Requirement
|
145
116
|
requirements:
|
146
|
-
- - "
|
117
|
+
- - ">="
|
147
118
|
- !ruby/object:Gem::Version
|
148
|
-
version: '
|
119
|
+
version: '0'
|
149
120
|
type: :development
|
150
121
|
prerelease: false
|
151
122
|
version_requirements: !ruby/object:Gem::Requirement
|
152
123
|
requirements:
|
153
|
-
- - "
|
124
|
+
- - ">="
|
154
125
|
- !ruby/object:Gem::Version
|
155
|
-
version: '
|
126
|
+
version: '0'
|
156
127
|
- !ruby/object:Gem::Dependency
|
157
|
-
name:
|
128
|
+
name: minitest-rg
|
158
129
|
requirement: !ruby/object:Gem::Requirement
|
159
130
|
requirements:
|
160
|
-
- - "
|
131
|
+
- - ">="
|
161
132
|
- !ruby/object:Gem::Version
|
162
|
-
version: 0
|
133
|
+
version: '0'
|
163
134
|
type: :development
|
164
135
|
prerelease: false
|
165
136
|
version_requirements: !ruby/object:Gem::Requirement
|
166
137
|
requirements:
|
167
|
-
- - "
|
138
|
+
- - ">="
|
168
139
|
- !ruby/object:Gem::Version
|
169
|
-
version: 0
|
140
|
+
version: '0'
|
170
141
|
- !ruby/object:Gem::Dependency
|
171
|
-
name:
|
142
|
+
name: mocha
|
172
143
|
requirement: !ruby/object:Gem::Requirement
|
173
144
|
requirements:
|
174
|
-
- - "
|
145
|
+
- - ">="
|
175
146
|
- !ruby/object:Gem::Version
|
176
|
-
version: 0
|
147
|
+
version: '0'
|
177
148
|
type: :development
|
178
149
|
prerelease: false
|
179
150
|
version_requirements: !ruby/object:Gem::Requirement
|
180
151
|
requirements:
|
181
|
-
- - "
|
152
|
+
- - ">="
|
182
153
|
- !ruby/object:Gem::Version
|
183
|
-
version: 0
|
154
|
+
version: '0'
|
184
155
|
- !ruby/object:Gem::Dependency
|
185
|
-
name:
|
156
|
+
name: phenix
|
186
157
|
requirement: !ruby/object:Gem::Requirement
|
187
158
|
requirements:
|
188
|
-
- - "
|
159
|
+
- - ">="
|
189
160
|
- !ruby/object:Gem::Version
|
190
|
-
version:
|
161
|
+
version: 0.2.0
|
191
162
|
type: :development
|
192
163
|
prerelease: false
|
193
164
|
version_requirements: !ruby/object:Gem::Requirement
|
194
165
|
requirements:
|
195
|
-
- - "
|
166
|
+
- - ">="
|
196
167
|
- !ruby/object:Gem::Version
|
197
|
-
version:
|
168
|
+
version: 0.2.0
|
198
169
|
description: Easily run queries on shard and slave databases.
|
199
170
|
email:
|
200
|
-
- bquorning@zendesk.com
|
201
|
-
- gabe@zendesk.com
|
202
|
-
- pschambacher@zendesk.com
|
203
171
|
- mick@staugaard.com
|
172
|
+
- eac@zendesk.com
|
173
|
+
- ben@gimbo.net
|
204
174
|
executables: []
|
205
175
|
extensions: []
|
206
176
|
extra_rdoc_files: []
|
@@ -209,20 +179,14 @@ files:
|
|
209
179
|
- lib/active_record_shards.rb
|
210
180
|
- lib/active_record_shards/association_collection_connection_selection.rb
|
211
181
|
- lib/active_record_shards/configuration_parser.rb
|
212
|
-
- lib/active_record_shards/connection_handler.rb
|
213
|
-
- lib/active_record_shards/connection_pool.rb
|
214
|
-
- lib/active_record_shards/connection_specification.rb
|
215
|
-
- lib/active_record_shards/connection_switcher-4-2.rb
|
216
182
|
- lib/active_record_shards/connection_switcher-5-0.rb
|
217
183
|
- lib/active_record_shards/connection_switcher-5-1.rb
|
218
184
|
- lib/active_record_shards/connection_switcher.rb
|
219
185
|
- lib/active_record_shards/default_slave_patches.rb
|
220
|
-
- lib/active_record_shards/migration.rb
|
221
186
|
- lib/active_record_shards/model.rb
|
222
|
-
- lib/active_record_shards/patches-4-2.rb
|
223
|
-
- lib/active_record_shards/schema_dumper_extension.rb
|
224
187
|
- lib/active_record_shards/shard_selection.rb
|
225
188
|
- lib/active_record_shards/shard_support.rb
|
189
|
+
- lib/active_record_shards/sharded_model.rb
|
226
190
|
- lib/active_record_shards/sql_comments.rb
|
227
191
|
- lib/active_record_shards/tasks.rb
|
228
192
|
homepage: https://github.com/zendesk/active_record_shards
|
@@ -235,16 +199,17 @@ require_paths:
|
|
235
199
|
- lib
|
236
200
|
required_ruby_version: !ruby/object:Gem::Requirement
|
237
201
|
requirements:
|
238
|
-
- - "
|
202
|
+
- - "~>"
|
239
203
|
- !ruby/object:Gem::Version
|
240
|
-
version: '2.
|
204
|
+
version: '2.0'
|
241
205
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
242
206
|
requirements:
|
243
|
-
- - "
|
207
|
+
- - ">"
|
244
208
|
- !ruby/object:Gem::Version
|
245
|
-
version:
|
209
|
+
version: 1.3.1
|
246
210
|
requirements: []
|
247
|
-
|
211
|
+
rubyforge_project:
|
212
|
+
rubygems_version: 2.6.13
|
248
213
|
signing_key:
|
249
214
|
specification_version: 4
|
250
215
|
summary: Simple database switching for ActiveRecord.
|