cassandra-helpers 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/cassandra-helpers.gemspec +1 -1
- data/lib/cassandra-helpers.rb +6 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1d41d12e68e374a2c130e10a148f3bc8850835f4a85ac36fcdf1b878c3805172
|
4
|
+
data.tar.gz: 466f3b645002c4024c95ef640b86b3d5b54eef4e3eae1eb03221c0ebd8be8c61
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d6cc3059ae14267cc5058a3eeaacf15af4cb326546515d6704995f27f148767806d79756a204d4f1690e21185745422155487ec260e96345abb87b8a5c452c9a
|
7
|
+
data.tar.gz: 6ac7a000ba60708d6a6087b0380c45355b841b723b69a19030e33f9ebd37361cb0689737a7be6f4d4aea466649db7866d01eccabdc6aa72b617028b1f54c00c3
|
data/cassandra-helpers.gemspec
CHANGED
data/lib/cassandra-helpers.rb
CHANGED
@@ -47,6 +47,12 @@ module CassandraHelpers
|
|
47
47
|
end
|
48
48
|
end
|
49
49
|
|
50
|
+
def find_record(session, table, keys)
|
51
|
+
cql = "SELECT * FROM #{Cassandra::Util.escape_name(table.name)} WHERE "
|
52
|
+
cql += table.primary_key.map { |key| "#{Cassandra::Util.escape_name(key.name)} = #{Cassandra::Util.encode_object(keys[key.name])}" }.join(' AND ')
|
53
|
+
execute_query(session, cql)
|
54
|
+
end
|
55
|
+
|
50
56
|
def each_record(session, cql, page_size = 100)
|
51
57
|
result = execute_query(session, cql, page_size: page_size)
|
52
58
|
loop do
|