mirror of https://gitee.com/bigwinds/arangodb
added derived file
This commit is contained in:
parent
db9e9d7c47
commit
9f6baaef1e
|
@ -603,13 +603,14 @@ function processQuery (query, explain) {
|
|||
|
||||
stringBuilder.appendLine();
|
||||
printIndexes(indexes);
|
||||
stringBuilder.appendLine();
|
||||
printRules(plan.rules);
|
||||
printModificationFlags(modificationFlags);
|
||||
printWarnings(explain.warnings);
|
||||
}
|
||||
|
||||
/* the exposed function */
|
||||
function explain (data, options) {
|
||||
function explain (data, options, shouldPrint) {
|
||||
'use strict';
|
||||
if (typeof data === "string") {
|
||||
data = { query: data };
|
||||
|
@ -626,9 +627,13 @@ function explain (data, options) {
|
|||
|
||||
stringBuilder.clearOutput();
|
||||
processQuery(data.query, result, true);
|
||||
print(stringBuilder.getOutput());
|
||||
|
||||
return stringBuilder.getOutput();
|
||||
if (shouldPrint === undefined || shouldPrint) {
|
||||
print(stringBuilder.getOutput());
|
||||
}
|
||||
else {
|
||||
return stringBuilder.getOutput();
|
||||
}
|
||||
}
|
||||
|
||||
exports.explain = explain;
|
||||
|
|
Loading…
Reference in New Issue