sequel-schema-sharding 0.13.2 → 0.13.3
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ba93f3ab93d0d5acb16f1744691a65d48fc4acbb
|
4
|
+
data.tar.gz: 49ac8402312a3abc096e5b794967a4200449137a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: abb6df783d89a0afceeb0316dc15c2961372cf236c05b6f3a4820857567086546a626f39f683d42e6d1fd9f0d20a62d6f3793a84978a700b0e09cc76af6f851d
|
7
|
+
data.tar.gz: 451cdde8165de1bd4de27dde528042903de2bbd2248e1f6ac8765aac92f35c01885a08cc0c8d08833ffa3c06f14eae4dfc57d0cdba5c3786cf132439ac75c9f2
|
@@ -10,7 +10,7 @@ module Sequel
|
|
10
10
|
end
|
11
11
|
|
12
12
|
def read_only_shard_for
|
13
|
-
@read_only_probe ||= provider.probe(:model, :read_only_shard_for, :string, :integer)
|
13
|
+
@read_only_probe ||= provider.probe(:model, :read_only_shard_for, :string, :integer, :string)
|
14
14
|
end
|
15
15
|
|
16
16
|
def replica_hash_for
|
@@ -18,7 +18,7 @@ module Sequel
|
|
18
18
|
end
|
19
19
|
|
20
20
|
def shard_for
|
21
|
-
@shard_for_probe ||= provider.probe(:model, :shard_for, :string, :integer)
|
21
|
+
@shard_for_probe ||= provider.probe(:model, :shard_for, :string, :integer, :string)
|
22
22
|
end
|
23
23
|
|
24
24
|
def self.provider
|
@@ -56,13 +56,13 @@ module Sequel
|
|
56
56
|
ds.shard_number = result.shard_number
|
57
57
|
ds.model = self
|
58
58
|
ds.tap do |d|
|
59
|
-
Sequel::SchemaSharding::DTraceProvider.provider.shard_for.fire(id.to_s, d.shard_number) if Sequel::SchemaSharding::DTraceProvider.provider.shard_for.enabled?
|
59
|
+
Sequel::SchemaSharding::DTraceProvider.provider.shard_for.fire(id.to_s, d.shard_number, self.table_name_s) if Sequel::SchemaSharding::DTraceProvider.provider.shard_for.enabled?
|
60
60
|
end
|
61
61
|
end
|
62
62
|
|
63
63
|
def read_only_shard_for(id)
|
64
64
|
shard_for(id).server(:read_only).tap do |d|
|
65
|
-
Sequel::SchemaSharding::DTraceProvider.provider.read_only_shard_for.fire(id.to_s, d.shard_number) if Sequel::SchemaSharding::DTraceProvider.provider.read_only_shard_for.enabled?
|
65
|
+
Sequel::SchemaSharding::DTraceProvider.provider.read_only_shard_for.fire(id.to_s, d.shard_number, self.table_name_s) if Sequel::SchemaSharding::DTraceProvider.provider.read_only_shard_for.enabled?
|
66
66
|
end
|
67
67
|
end
|
68
68
|
|
@@ -83,6 +83,10 @@ module Sequel
|
|
83
83
|
m.values[:shard_number] = shard_number
|
84
84
|
end
|
85
85
|
end
|
86
|
+
|
87
|
+
def table_name_s
|
88
|
+
@table_name_as_string ||= self.table_name.to_s
|
89
|
+
end
|
86
90
|
end
|
87
91
|
|
88
92
|
# The database connection that has the logical shard.
|
@@ -43,7 +43,7 @@ describe Sequel::SchemaSharding::DTraceProvider do
|
|
43
43
|
end
|
44
44
|
|
45
45
|
it 'takes a string argument' do
|
46
|
-
expect(provider.read_only_shard_for.arguments).to eq([:string, :integer])
|
46
|
+
expect(provider.read_only_shard_for.arguments).to eq([:string, :integer, :string])
|
47
47
|
end
|
48
48
|
end
|
49
49
|
|
@@ -61,7 +61,7 @@ describe Sequel::SchemaSharding::DTraceProvider do
|
|
61
61
|
end
|
62
62
|
|
63
63
|
it 'takes a string argument' do
|
64
|
-
expect(provider.read_only_shard_for.arguments).to eq([:string, :integer])
|
64
|
+
expect(provider.read_only_shard_for.arguments).to eq([:string, :integer, :string])
|
65
65
|
end
|
66
66
|
end
|
67
67
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sequel-schema-sharding
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.13.
|
4
|
+
version: 0.13.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Paul Henry
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2014-11-
|
13
|
+
date: 2014-11-19 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: sequel
|
@@ -194,4 +194,3 @@ test_files:
|
|
194
194
|
- spec/schema-sharding/ring_spec.rb
|
195
195
|
- spec/spec_helper.rb
|
196
196
|
- spec/support/database_helper.rb
|
197
|
-
has_rdoc:
|