Skip to content
This repository has been archived by the owner on Feb 22, 2019. It is now read-only.

Commit

Permalink
Merge pull request #119 from simong/boolean-parameter
Browse files Browse the repository at this point in the history
Allow for boolean parameters in cql calls
  • Loading branch information
devdazed committed Oct 9, 2013
2 parents 6153e89 + 32e1050 commit edbd396
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/connection.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ function escapeCQL(val) {
return val.toString('hex');
}

if(typeof val === 'number'){
if(typeof val === 'number' || typeof val === 'boolean'){
return val.toString();
}

Expand Down
11 changes: 11 additions & 0 deletions test/cql2.js
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,17 @@ module.exports = {
});
},

'test cql update with boolean value':function(test, assert){
conn.cql(config['update_uuid#cql'], [true, 'bb85f040-30c3-11e3-aa6e-0800200c9a66'], function(err, res){
assert.ifError(err);
conn.cql(config['select_uuid#cql'], ['bb85f040-30c3-11e3-aa6e-0800200c9a66'], function(err, res){
assert.ifError(err);
assert.ok(res[0].get('body').value === 'true');
test.finish();
});
});
},

'test cql update reversed':function(test, assert){
conn.cql(config['update_reversed#cql'], function(err, res){
assert.ifError(err);
Expand Down

0 comments on commit edbd396

Please sign in to comment.