Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

added support for ReversedType in CQL2 [ closes #67 ]

  • Loading branch information...
commit face5a9c7029e0dcdfd316ac7c21d318515e25c0 1 parent 5895934
@devdazed devdazed authored
View
5 History.md
@@ -163,3 +163,8 @@
==================
* Fixed issue with serializatoin of start / end in range queries [ @devdazed ]
+
+0.5.7 / 2012-08-26
+==================
+
+ * Fixed issue with deserialization of ReversedType in CQL [ @devdazed #67 ]
View
3  lib/marshal/index.js
@@ -37,7 +37,8 @@ var TYPES = {
'DateType':{ ser:Serializers.encodeDate, de:Deserializers.decodeDate },
'BooleanType':{ ser:Serializers.encodeBoolean, de:Deserializers.decodeBoolean },
'UUIDType': { ser:Serializers.encodeUUID, de:Deserializers.decodeUUID },
- 'CompositeType': { ser:NOOP, de:NOOP }
+ 'CompositeType': { ser:NOOP, de:NOOP },
+ 'ReversedType': { ser:IDENTITY, de:IDENTITY }
};
/**
View
2  package.json
@@ -1,6 +1,6 @@
{
"name": "helenus"
- , "version": "0.5.6"
+ , "version": "0.5.7"
, "description": "NodeJS Bindings for Cassandra"
, "keywords": ["cassandra"]
, "author": "Russell Bradberry <rbradberry@gmail.com>"
View
27 test/cql2.js
@@ -56,6 +56,14 @@ module.exports = {
});
},
+ 'test cql create reversed column family':function(test, assert){
+ conn.cql(config['create_reversed_cf#cql'], function (err, res){
+ assert.ifError(err);
+ assert.ok(res === undefined);
+ test.finish();
+ });
+ },
+
'test cql update':function(test, assert){
conn.cql(config['update#cql'], function(err, res){
assert.ifError(err);
@@ -64,6 +72,14 @@ module.exports = {
});
},
+ 'test cql update reversed':function(test, assert){
+ conn.cql(config['update_reversed#cql'], function(err, res){
+ assert.ifError(err);
+ assert.ok(res === undefined);
+ test.finish();
+ });
+ },
+
'test cql update with no callback':function(test, assert){
conn.cql(config['update#cql']);
@@ -91,6 +107,17 @@ module.exports = {
});
},
+ 'test cql select reversed':function(test, assert){
+ conn.cql(config['select_reversed#cql'], function(err, res){
+ assert.ifError(err);
+ assert.ok(res.length === 1);
+ assert.ok(res[0] instanceof Helenus.Row);
+ assert.ok(res[0].get('foo').value === 'bar');
+
+ test.finish();
+ });
+ },
+
'test cql select *': function(test, assert){
conn.cql(config['select*#cql'], function (err, res){
assert.ifError(err);
View
3  test/helpers/cql2.json
@@ -2,14 +2,17 @@
"use#cql" : "USE helenus_cql_test",
"create_ks#cql" : "CREATE KEYSPACE helenus_cql_test WITH strategy_class=SimpleStrategy AND strategy_options:replication_factor=1",
"create_cf#cql" : "CREATE COLUMNFAMILY cql_test (KEY text PRIMARY KEY) WITH default_validation=UTF8Type and comparator=UTF8Type",
+ "create_reversed_cf#cql" : "CREATE COLUMNFAMILY cql_rev_test (KEY text PRIMARY KEY) WITH default_validation=UTF8Type and comparator='UTF8Type(reversed=true)'",
"create_counter_cf#cql" : "CREATE COLUMNFAMILY cql_cnt_test (KEY text PRIMARY KEY) WITH default_validation=CounterColumnType and comparator=UTF8Type",
"drop_ks#cql" : "DROP KEYSPACE helenus_cql_test",
"drop_cf#cql" : "DROP COLUMNFAMILY cql_test",
"update#cql" : "UPDATE cql_test SET foo='bar' WHERE KEY='foobar'",
+ "update_reversed#cql" : "UPDATE cql_rev_test SET foo='bar' WHERE KEY='foobar'",
"incr#cql" : "UPDATE cql_cnt_test set foo = foo + 10 WHERE KEY='foobar'",
"select#cql" : "SELECT foo FROM cql_test WHERE KEY='foobar'",
"select*#cql" : "SELECT * FROM cql_test WHERE KEY='foobar'",
"select_counter#cql" : "SELECT foo FROM cql_cnt_test WHERE KEY='foobar'",
+ "select_reversed#cql" : "SELECT foo FROM cql_rev_test WHERE KEY='foobar'",
"count#cql" : "SELECT COUNT(*) FROM cql_test WHERE KEY='foobar'",
"delete#cql" : "DELETE FROM cql_test WHERE KEY='foobar'",
"select2#cql" : "SELECT * FROM cql_test WHERE KEY='%s'",
Please sign in to comment.
Something went wrong with that request. Please try again.