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 +4 -4
- data/lib/txdb/iterators/auto_increment_iterator.rb +11 -7
- data/lib/txdb/version.rb +1 -1
- data/spec/test.sqlite3 +0 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f78d330f2df64d6ccfe5bf87fae14eb81bc2f187
|
4
|
+
data.tar.gz: 4db1ddc08a4a01c03c2458843d6cd9648ba0a1b3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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 =
|
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
|
data/lib/txdb/version.rb
CHANGED
data/spec/test.sqlite3
CHANGED
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.
|
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-
|
11
|
+
date: 2016-07-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|