Skip to content
Browse files

fixed serialization in inspect

  • Loading branch information...
1 parent e5c3b82 commit 01208efe84f6517b977cbd3dbf4046efb5c11d13 @devdazed devdazed committed Jan 6, 2012
Showing with 14 additions and 5 deletions.
  1. +7 −1 History.md
  2. +6 −3 lib/row.js
  3. +1 −1 package.json
View
8 History.md
@@ -10,4 +10,10 @@
* Added CQL Support
* More Robust Connection Pooling
* Respond with JS errors, not TException objects
- * Added proper serialization/deserialization support for all types
+ * Added proper serialization/deserialization support for all types
+
+0.1.1 / 2012-01-06
+==================
+
+ * Fixed issue with the deserialization of column names in insepct
+
View
9 lib/row.js
@@ -12,7 +12,6 @@ var Row = function(data, schema){
this._nameMarshaller = new Marshal(schema.default_name_type || 'BytesType');
this._map = {};
this._schema = schema;
- this._humanColumnNames = [];
for(; i < len; i += 1){
item = data.columns[i];
@@ -35,7 +34,6 @@ var Row = function(data, schema){
ttl:item.ttl
});
this._map[item.name] = i;
- this._humanColumnNames.push(name);
}
}
@@ -71,7 +69,12 @@ Row.prototype.get = function(name){
* Inspect method for columns
*/
Row.prototype.inspect = function(){
- return util.format("<Row: Key: '%s', ColumnCount: %s, Columns: [ '%s' ]>", this.key, this.length, this._humanColumnNames);
+ var i = 0, names = Object.keys(this._map), len = names.length, cols = [];
+ for(; i < len; i += 1){
+ cols.push(this._nameMarshaller.deserialize(names[i]));
+ }
+
+ return util.format("<Row: Key: '%s', ColumnCount: %s, Columns: [ '%s' ]>", this.key, this.length, cols);
};
/**
View
2 package.json
@@ -1,6 +1,6 @@
{
"name": "helenus"
- , "version": "0.1.0"
+ , "version": "0.1.1"
, "description": "NodeJS Bindings for Cassandra"
, "keywords": ["cassandra"]
, "author": "Russell Bradberry <rbradberry@gmail.com>"

0 comments on commit 01208ef

Please sign in to comment.
Something went wrong with that request. Please try again.