When you trying to execute WITH AS query with parameters, It's not working.
My solution is:
sqlite.prototype.run = function (sql, options, callback) {
if (typeof (options) == "function") {
callback = options;
options = [];
}
var results;
var type = sql.substring(0, 6);
type = type.toUpperCase();
if (type.startsWith('WITH')) {
type = 'WITH';
}
switch (type) {
case "SELECT":
case "WITH":
results = this.pvSELECT(sql, options);
break;
case "INSERT":
results = this.pvINSERT(sql, options);
break;
case "UPDATE":
results = this.pvUPDATE(sql, options);
break;
case "DELETE":
results = this.pvDELETE(sql, options);
break;
case "PRAGMA":
results = this.pvPRAGMA(sql, options);
break;
default:
results = this.runAll(sql)
}
if (callback) {
callback(results);
return this;
} else {
return results;
}
};
When you trying to execute
WITH ASquery with parameters, It's not working.My solution is: