sessionm-cassandra_object 4.0.8 → 4.0.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +13 -5
- data/lib/cassandra_object/adapters/cassandra_driver.rb +17 -0
- data/sessionm-cassandra_object.gemspec +1 -1
- metadata +7 -7
checksums.yaml
CHANGED
@@ -1,7 +1,15 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
|
2
|
+
!binary "U0hBMQ==":
|
3
|
+
metadata.gz: !binary |-
|
4
|
+
YWE4YjNlNjM2NWFjMDgxNWRjOTVmZDJlNmRjZDIwZGI5ZGFmMjMyYg==
|
5
|
+
data.tar.gz: !binary |-
|
6
|
+
MzA5ODFmM2EyM2Y3NjY2YTgwMjJlMDJlM2I2MTc2NmE0MGE4NzA0YQ==
|
5
7
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
|
8
|
+
metadata.gz: !binary |-
|
9
|
+
M2I4ZWFiN2RlMWNkMThlOGEyNTIwMjYwMjdmOTc1MTgyNTUyMzIxY2U0OGIw
|
10
|
+
YTAwZjUyZWM0YTQ2ODFhOWI2NThlODFkYTI3MGQ4ZmYxNTk5MzU5M2Q2YmNk
|
11
|
+
ZDE5ODEwYzE2Y2IwN2I2MjViOGFhMTdhNmZmMzkxZDA2ZjMxNGY=
|
12
|
+
data.tar.gz: !binary |-
|
13
|
+
ZmNlOWE0MTJlNjdhZDMzMmRjOTYyMzJmYmQyMzM2MzFmMzdhNjI0N2NhNTJi
|
14
|
+
OTVkN2I0YjVlNmQzMmI2MDE4OWQxOGFjZjJmZjk4Y2E4MjUxZjE1Mjc5MmQ0
|
15
|
+
NmRkMWQ4NWZlYzRmYTAwN2ZmM2NhNjBiNDJiYmU1ZTQ4NDZiNDU=
|
@@ -108,6 +108,23 @@ module CassandraObject
|
|
108
108
|
end
|
109
109
|
end
|
110
110
|
|
111
|
+
def get_columns(column_family, key, columns, opts)
|
112
|
+
async = opts.try(:[], :async)
|
113
|
+
|
114
|
+
key = "textAsBlob('#{key}')"
|
115
|
+
|
116
|
+
name_fields = columns.map { |c| "'#{c}'" }.join(', ')
|
117
|
+
|
118
|
+
query = "SELECT #{NAME_FIELD}, #{VALUE_FIELD} FROM \"#{column_family}\" WHERE #{NAME_FIELD} IN(#{name_fields}) AND #{KEY_FIELD} = #{key}"
|
119
|
+
|
120
|
+
result = async ? self.execute_async(query, execute_options(opts)) : self.execute(query, execute_options(opts))
|
121
|
+
return result if async
|
122
|
+
|
123
|
+
result
|
124
|
+
.inject({}) { |hsh, row| hsh[row[NAME_FIELD]] = row[VALUE_FIELD]; hsh }
|
125
|
+
.slice(*columns.map(&:to_s))
|
126
|
+
end
|
127
|
+
|
111
128
|
def add(column_family, key, by, fields, opts=nil)
|
112
129
|
async = opts.try(:[], :async)
|
113
130
|
fields = [fields] unless fields.is_a?(Array)
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sessionm-cassandra_object
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.0.
|
4
|
+
version: 4.0.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Michael Koziarski
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2015-
|
13
|
+
date: 2015-12-22 00:00:00.000000000 Z
|
14
14
|
dependencies: []
|
15
15
|
description: Cassandra ActiveModel
|
16
16
|
email: doug@sessionm.com
|
@@ -19,9 +19,9 @@ extensions: []
|
|
19
19
|
extra_rdoc_files:
|
20
20
|
- README.markdown
|
21
21
|
files:
|
22
|
-
-
|
23
|
-
-
|
24
|
-
-
|
22
|
+
- .gitignore
|
23
|
+
- .ruby-gemset
|
24
|
+
- .ruby-version
|
25
25
|
- CHANGELOG
|
26
26
|
- Gemfile
|
27
27
|
- Gemfile.lock
|
@@ -142,12 +142,12 @@ require_paths:
|
|
142
142
|
- lib
|
143
143
|
required_ruby_version: !ruby/object:Gem::Requirement
|
144
144
|
requirements:
|
145
|
-
- -
|
145
|
+
- - ! '>='
|
146
146
|
- !ruby/object:Gem::Version
|
147
147
|
version: '0'
|
148
148
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
149
149
|
requirements:
|
150
|
-
- -
|
150
|
+
- - ! '>='
|
151
151
|
- !ruby/object:Gem::Version
|
152
152
|
version: '0'
|
153
153
|
requirements: []
|