GQL icon indicating copy to clipboard operation
GQL copied to clipboard

select columns where value contains colons returned as null

Open marfarma opened this issue 12 years ago • 0 comments

The following test, from my pull request (see #4). when not commented out, fails. The value of the 'lunchTime' property is null in each returned row. This is not the case when selecting all columns, i.e. select '*'

I suspect it's related to the embedded colons, but it may be that it's attempting to parse the values as number and failing.

 
/* ------------ test is failing - lunchTime column is returned as null ------------- */
 +    // it("should return selected columns when one column is a time representation", function(done) {
 +    //   var query = {select: "lunchTime, name"};
 +    //   var expected = [{"lunchTime": "12:00:00", "name": "John"}, 
 +    //                  {"lunchTime": "12:00:00", "name": "Dave"}, 
 +    //                  {"lunchTime": "13:00:00", "name": "Sally"}, 
 +    //                  {"lunchTime": "12:00:00", "name": "Ben"}, 
 +    //                  {"lunchTime": "12:00:00", "name": "Dana"}, 
 +    //                  {"lunchTime": "13:00:00", "name": "Mike"}];
 +    //   
 +    //   PouchDB.plugin('gql', GQL);
 +    //   PouchDB('testdb',function(err,db){
 +    //       db.gql(query, function(err, actual){
 +    //         if(!err){
 +    //             var intersection = expected.filter(function(n) {
 +    //               return _.findWhere(actual.rows, n) != undefined
 +    //             });
 +    //             console.log(" ");
 +    //             for (var i=0; i

marfarma avatar Jan 21 '14 17:01 marfarma