1
0
Fork 0

aql explainer support for bind params

This commit is contained in:
hkernbach 2015-11-17 13:10:47 +01:00
parent 8dbcf9e940
commit f21cb27dca
1 changed files with 8 additions and 1 deletions

View File

@ -676,7 +676,7 @@ function processQuery (query, explain) {
}
/* the exposed function */
function explain (data, options, shouldPrint) {
function explain (data, options, shouldPrint, bindVars) {
'use strict';
if (typeof data === "string") {
data = { query: data };
@ -689,6 +689,13 @@ function explain (data, options, shouldPrint) {
setColors(options.colors === undefined ? true : options.colors);
var stmt = db._createStatement(data);
if (typeof bindVars === 'object') {
Object.keys(bindVars).forEach(function(key) {
stmt.bind(key, bindVars[key]);
});
}
var result = stmt.explain(options);
stringBuilder.clearOutput();