From 00741bc0a4a9b773d781063b168f9f2e8e9e86a7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Garc=C3=ADa=20Aubert?= Date: Tue, 5 Sep 2017 10:41:48 +0200 Subject: [PATCH] Use template string for basicsQueryTpl --- lib/cartodb/models/dataview/histogram.js | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/lib/cartodb/models/dataview/histogram.js b/lib/cartodb/models/dataview/histogram.js index 3f31bea8..11fe7bda 100644 --- a/lib/cartodb/models/dataview/histogram.js +++ b/lib/cartodb/models/dataview/histogram.js @@ -68,14 +68,14 @@ const filteredQueryTpl = ctx => ` ) `; -var basicsQueryTpl = dot.template([ - '__cdb_basics AS (', - ' SELECT', - ' max({{=it._column}}) AS __cdb_max_val, min({{=it._column}}) AS __cdb_min_val,', - ' avg({{=it._column}}) AS __cdb_avg_val, count(1) AS __cdb_total_rows', - ' FROM __cdb_filtered_source', - ')' -].join(' \n')); +const basicsQueryTpl = ctx => ` + __cdb_basics AS ( + SELECT + max(${ctx._column}) AS __cdb_max_val, min(${ctx._column}) AS __cdb_min_val, + avg(${ctx._column}) AS __cdb_avg_val, count(1) AS __cdb_total_rows + FROM __cdb_filtered_source + ) +`; var overrideBasicsQueryTpl = dot.template([ '__cdb_basics AS (',