ocean-dynamo 0.6.4 → 0.6.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/ocean-dynamo/queries.rb +16 -4
- data/lib/ocean-dynamo/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 586ff6c721434d0dc2825584bbdda16ab3c581ca
|
4
|
+
data.tar.gz: 1e5393a205a663c4e10844c8451a9b3a560e099f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 66dc1832eba9a0d29745fd7cee6371f50df1d54919cc51a790a3d709a4a0a7827c46ee0e47927210497747a28522d7d093c82956a9209e767969b522733b70a0
|
7
|
+
data.tar.gz: 56d479377f699c6e7e435642828393e06b9be039b5ca1704543f4e752eda882918f4367856bbcefe33bf7c700a765053ed187bc7ce06b212026b2871d835c5d5
|
data/lib/ocean-dynamo/queries.rb
CHANGED
@@ -43,8 +43,14 @@ module OceanDynamo
|
|
43
43
|
def all(consistent: false, **options)
|
44
44
|
_late_connect?
|
45
45
|
result = []
|
46
|
-
|
47
|
-
|
46
|
+
if consistent
|
47
|
+
dynamo_items.each(options) do |item|
|
48
|
+
result << new._setup_from_dynamo(item, consistent: consistent)
|
49
|
+
end
|
50
|
+
else
|
51
|
+
dynamo_items.select(options) do |item_data|
|
52
|
+
result << new._setup_from_dynamo(item_data)
|
53
|
+
end
|
48
54
|
end
|
49
55
|
result
|
50
56
|
end
|
@@ -58,8 +64,14 @@ module OceanDynamo
|
|
58
64
|
# thereby greatly reducing memory consumption.
|
59
65
|
#
|
60
66
|
def find_each(limit: nil, batch_size: 1000, consistent: false)
|
61
|
-
|
62
|
-
|
67
|
+
if consistent
|
68
|
+
dynamo_items.each(limit: limit, batch_size: batch_size) do |item|
|
69
|
+
yield new._setup_from_dynamo(item, consistent: consistent)
|
70
|
+
end
|
71
|
+
else
|
72
|
+
dynamo_items.select(limit: limit, batch_size: batch_size) do |item_data|
|
73
|
+
yield new._setup_from_dynamo(item_data)
|
74
|
+
end
|
63
75
|
end
|
64
76
|
true
|
65
77
|
end
|
data/lib/ocean-dynamo/version.rb
CHANGED