cequel 3.1.0 → 3.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +3 -0
- data/Gemfile.lock +1 -1
- data/README.md +19 -0
- data/lib/cequel/record/record_set.rb +1 -1
- data/lib/cequel/version.rb +1 -1
- data/spec/examples/record/record_set_spec.rb +8 -1
- 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: 06737301a7c04005670f2c38aa69a50d08a8166a
|
4
|
+
data.tar.gz: 9253937c264d5d6ef64a3861aa1d909779b9f853
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3e1d63bb14b7f0f7d365533274a54805cce8298c65bb8128715af69338487f41190dda0912ae2980e27a5b021de60d763cc2a697043ef087607ea1071d1776c1
|
7
|
+
data.tar.gz: 1c0f57e5b8f3a53624da0a5eb694a4786ab59a362883cf0e3d4296a805947c0106e67310ba8bb5adf6c66cb17fd3ef1b8888b1ea3f9a0bed4c34656327b547b9
|
data/CHANGELOG.md
CHANGED
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -150,6 +150,25 @@ module Blogger
|
|
150
150
|
end
|
151
151
|
```
|
152
152
|
|
153
|
+
### Compound Partition Keys ###
|
154
|
+
|
155
|
+
If you wish to declare a compound partition key in a model, you can do something like:
|
156
|
+
|
157
|
+
```ruby
|
158
|
+
class Post
|
159
|
+
include Cequel::Record
|
160
|
+
|
161
|
+
key :country, :text, partition: true
|
162
|
+
key :blog, :text, partition: true
|
163
|
+
key :id, :timeuuid, auto: true
|
164
|
+
column :title, :text
|
165
|
+
column :body, :text
|
166
|
+
end
|
167
|
+
```
|
168
|
+
|
169
|
+
Your compound partition key here is `(country, blog)`, and the entire compound primary key is `((country, blog), id)`.
|
170
|
+
Any key values defined after the last partition key value are clustering columns.
|
171
|
+
|
153
172
|
### Timestamps ###
|
154
173
|
|
155
174
|
If your final primary key column is a `timeuuid` with the `:auto` option set,
|
@@ -846,7 +846,7 @@ module Cequel
|
|
846
846
|
"Can't scope key column #{column_name} without also scoping " \
|
847
847
|
"#{missing_column_names.join(', ')}"
|
848
848
|
end
|
849
|
-
if scoped_indexed_column
|
849
|
+
if scoped_indexed_column && !allow_filtering
|
850
850
|
fail IllegalQuery,
|
851
851
|
"Can't scope by more than one indexed column in the same query"
|
852
852
|
end
|
data/lib/cequel/version.rb
CHANGED
@@ -819,9 +819,16 @@ describe Cequel::Record::RecordSet do
|
|
819
819
|
end
|
820
820
|
|
821
821
|
context 'allow_filtering!', cql: '~> 3.4' do
|
822
|
-
it 'should allow filtering for
|
822
|
+
it 'should allow filtering for non-indexed columns' do
|
823
823
|
expect(Post.allow_filtering!.where(title: 'Cequel 0').entries.length).to be(1)
|
824
824
|
end
|
825
|
+
|
826
|
+
it 'should allow filtering for more than one non-indexed column' do
|
827
|
+
expect(Post.allow_filtering!.where(
|
828
|
+
title: 'Cequel 0',
|
829
|
+
body: 'Post number 0'
|
830
|
+
).entries.length).to be(1)
|
831
|
+
end
|
825
832
|
end
|
826
833
|
end
|
827
834
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cequel
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.
|
4
|
+
version: 3.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mat Brown
|
@@ -31,7 +31,7 @@ authors:
|
|
31
31
|
autorequire:
|
32
32
|
bindir: bin
|
33
33
|
cert_chain: []
|
34
|
-
date:
|
34
|
+
date: 2019-01-02 00:00:00.000000000 Z
|
35
35
|
dependencies:
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: activemodel
|