// Add callbacks for pre & post run
this.onPreRun.push(function(apiCalls) {
- apiCalls.run.debug = true;
+ // So the raw SQL can be shown in the "Query Info" tab
+ apiCalls.run[2].debug = true;
});
this.onPostRun.push(function(apiResults) {
+ // Add debug output (e.g. raw SQL) to the "Query Info" tab
ctrl.debug = _.extend(_.pick(ctrl.debug, 'apiParams'), apiResults.run.debug);
});
this.$onInit = function() {
var tallyParams;
+ // Copy API params from the run and adapt them in a secondary `tally` call for the "Totals" row
if (ctrl.settings.tally) {
ctrl.onPreRun.push(function (apiCalls) {
ctrl.tally = null;
- tallyParams = _.cloneDeep(apiCalls.run);
+ tallyParams = _.cloneDeep(apiCalls.run[2]);
});
ctrl.onPostRun.push(function (apiResults, status) {