txdb 2.0.0 → 2.1.0

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: 3bc37bfdf9e73758b78be101dc440f0354078f8d
4
- data.tar.gz: e71385526e032e713be01aa01ce0a0277f11c84d
3
+ metadata.gz: f78d330f2df64d6ccfe5bf87fae14eb81bc2f187
4
+ data.tar.gz: 4db1ddc08a4a01c03c2458843d6cd9648ba0a1b3
5
5
  SHA512:
6
- metadata.gz: c14ff5270d2d43875180d98e5d27a64fc03f822bde72e0ed6b718ed502281f4aa4b8a0df00bcb4cebd090b11ff61d3a5d1469556b6b7fc9aaecaff1ac4e646d8
7
- data.tar.gz: 88b8256d21d523d520e5cc9942fdf784f6719a102a26eb92ce1a3b6210fd43699249ebd6b9eb57fae48d529645f9d27b4a2e01bd17e575b3e77783fdaa63c19e
6
+ metadata.gz: 54034a53d6127b8b372db66fb6f84a8411b7264774ea17f6c637059d3b29020bc87f8b944a886d9d3b48fe01d073c46600ca5b20fb35787ece6dc23f0cd63137
7
+ data.tar.gz: d5c9d18a27ac021720af42778f2110d528377d3ce76ecfab743c8e4bd11c299fd5e24984e3cae1d2e4c38d7f6b0fc6a095ab1ca7fb1f824164b28fcd009b7672
@@ -19,15 +19,9 @@ module Txdb
19
19
 
20
20
  counter = 0
21
21
  last_value = nil
22
- sql_column = Sequel.expr(column)
23
22
 
24
23
  loop do
25
- records = table.connection
26
- .from(table_name)
27
- .where { sql_column >= counter }
28
- .order(column)
29
- .limit(batch_size)
30
-
24
+ records = records_since(counter)
31
25
  break if records.count == 0
32
26
 
33
27
  records.each do |record|
@@ -53,6 +47,16 @@ module Txdb
53
47
 
54
48
  private
55
49
 
50
+ def records_since(counter)
51
+ sql_column = Sequel.expr(column)
52
+
53
+ table.connection
54
+ .from(table_name)
55
+ .where { sql_column >= counter }
56
+ .order(column)
57
+ .limit(batch_size)
58
+ end
59
+
56
60
  def table_name
57
61
  table.name
58
62
  end
@@ -1,3 +1,3 @@
1
1
  module Txdb
2
- VERSION = '2.0.0'
2
+ VERSION = '2.1.0'
3
3
  end
Binary file
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: txdb
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.0
4
+ version: 2.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Cameron Dutro
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-06-07 00:00:00.000000000 Z
11
+ date: 2016-07-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport