cql-rb 1.0.1 → 1.0.2

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.
data/README.md CHANGED
@@ -43,6 +43,12 @@ or using CQL:
43
43
  client.execute('USE measurements')
44
44
  ```
45
45
 
46
+ If your keyspace has upper case characters you need to quote the keyspace name _(this is supported in v1.0.2 and later)_:
47
+
48
+ ```ruby
49
+ client.execute('USE "Measurements"')
50
+ ```
51
+
46
52
  ## Running queries
47
53
 
48
54
  You run CQL statements by passing them to `#execute`. Most statements don't have any result and the call will return nil.
@@ -126,7 +126,7 @@ module Cql
126
126
 
127
127
  private
128
128
 
129
- KEYSPACE_NAME_PATTERN = /^\w[\w\d_]*$/
129
+ KEYSPACE_NAME_PATTERN = /^\w[\w\d_]*$|^"\w[\w\d_]*"$/
130
130
  DEFAULT_CONSISTENCY_LEVEL = :quorum
131
131
 
132
132
  def valid_keyspace_name?(name)
data/lib/cql/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # encoding: utf-8
2
2
 
3
3
  module Cql
4
- VERSION = '1.0.1'.freeze
4
+ VERSION = '1.0.2'.freeze
5
5
  end
@@ -202,6 +202,13 @@ module Cql
202
202
  it 'raises an error if the keyspace name is not valid' do
203
203
  expect { client.use('system; DROP KEYSPACE system').get }.to raise_error(InvalidKeyspaceNameError)
204
204
  end
205
+
206
+ it 'allows the keyspace name to be quoted' do
207
+ io_reactor.queue_response(Protocol::SetKeyspaceResultResponse.new('system'))
208
+ client.connect.get
209
+ client.use('"system"').get
210
+ client.keyspace.should == "system"
211
+ end
205
212
  end
206
213
 
207
214
  describe '#execute' do
@@ -474,4 +481,4 @@ module Cql
474
481
  end
475
482
  end
476
483
  end
477
- end
484
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cql-rb
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.0.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-06-29 00:00:00.000000000 Z
12
+ date: 2013-07-28 00:00:00.000000000 Z
13
13
  dependencies: []
14
14
  description: A pure Ruby CQL3 driver for Cassandra
15
15
  email:
@@ -112,7 +112,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
112
112
  version: '0'
113
113
  segments:
114
114
  - 0
115
- hash: 2653215981660413619
115
+ hash: 1249323272134988131
116
116
  requirements: []
117
117
  rubyforge_project:
118
118
  rubygems_version: 1.8.23