Skip to content

Commit

Permalink
removed some warnings, added support for custom expression in SET cla…
Browse files Browse the repository at this point in the history
…uses
  • Loading branch information
xavierlacot committed Feb 21, 2011
1 parent c08f342 commit c62bc6e
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions joli.js
Expand Up @@ -181,7 +181,7 @@ joli.migration.prototype = {
if (version.length > 0) {
return version[0].version;
} else {
var q = new joli.query().insertInto(this.table).values({ version: 0 });
q = new joli.query().insertInto(this.table).values({ version: 0 });
q.execute();
return 0;
}
Expand Down Expand Up @@ -515,11 +515,12 @@ joli.query.prototype = {
//Titanium.API.log('debug', 'hydrating ' + rows.rowCount + ' rows.');
var i;
var rowData;
var fieldCount;

if (Titanium.Platform.name != 'android') {
var fieldCount = rows.fieldCount();
fieldCount = rows.fieldCount();
} else {
var fieldCount = rows.fieldCount;
fieldCount = rows.fieldCount;
}

while (rows.isValidRow()) {
Expand Down Expand Up @@ -576,7 +577,12 @@ joli.query.prototype = {

set: function(values) {
joli.each(values, function(expression, value) {
this.data.set.push(value + ' = ' + joli.typeValue(expression));
if (-1 === value.indexOf('=')) {
this.data.set.push(value + ' = ' + joli.typeValue(expression));
} else {
// some particular expression containing "="
this.data.set.push(value);
}
}, this);
return this;
},
Expand Down

0 comments on commit c62bc6e

Please sign in to comment.