mirror of https://gitee.com/bigwinds/arangodb
aql explainer support for bind params
This commit is contained in:
parent
8dbcf9e940
commit
f21cb27dca
|
@ -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();
|
||||
|
|
Loading…
Reference in New Issue