Remove string template in the middle
This commit is contained in:
@@ -130,40 +130,15 @@ const aggregationQueryTpl = ctx => `
|
||||
ORDER BY value DESC
|
||||
`;
|
||||
|
||||
const categoriesCTESqlTpl = ctx => `
|
||||
WITH
|
||||
${filteredQueryTpl({
|
||||
isFloatColumn: ctx.isFloatColumn,
|
||||
query: ctx.query,
|
||||
column: ctx.column,
|
||||
aggregationColumn: ctx.aggregationColumn
|
||||
})},
|
||||
${summaryQueryTpl({
|
||||
isFloatColumn: ctx.isFloatColumn,
|
||||
query: ctx.query,
|
||||
column: ctx.column,
|
||||
aggregationColumn: ctx.aggregationColumn
|
||||
})},
|
||||
${rankedCategoriesQueryTpl({
|
||||
query: ctx.query,
|
||||
column: ctx.column,
|
||||
aggregationFn: ctx.aggregationFn,
|
||||
aggregationColumn: ctx.aggregationColumn
|
||||
})},
|
||||
${categoriesSummaryMinMaxQueryTpl({
|
||||
query: ctx.query,
|
||||
column: ctx.column
|
||||
})},
|
||||
${categoriesSummaryCountQueryTpl({
|
||||
query: ctx.query,
|
||||
column: ctx.column
|
||||
})}
|
||||
`;
|
||||
|
||||
const aggregationFnQueryTpl = ctx => `${ctx.aggregation}(${ctx.aggregationColumn})`;
|
||||
|
||||
const aggregationSqlTpl = ctx => `
|
||||
${categoriesCTESqlTpl(ctx)}
|
||||
const aggregationDataviewQueryTpl = ctx => `
|
||||
WITH
|
||||
${filteredQueryTpl(ctx)},
|
||||
${summaryQueryTpl(ctx)},
|
||||
${rankedCategoriesQueryTpl(ctx)},
|
||||
${categoriesSummaryMinMaxQueryTpl(ctx)},
|
||||
${categoriesSummaryCountQueryTpl(ctx)}
|
||||
${!!ctx.override.ownFilter ? `${aggregationQueryTpl(ctx)}` : `${rankedAggregationQueryTpl(ctx)}`}
|
||||
`;
|
||||
|
||||
@@ -242,7 +217,7 @@ Aggregation.prototype.sql = function(psql, override, callback) {
|
||||
return null;
|
||||
}
|
||||
|
||||
var aggregationSql = aggregationSqlTpl({
|
||||
var aggregationSql = aggregationDataviewQueryTpl({
|
||||
override: override,
|
||||
query: this.query,
|
||||
column: this.column,
|
||||
|
||||
Reference in New Issue
Block a user