From 11f7b38c6975144ff3ac9abfb0aae19f085e23c9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Garc=C3=ADa=20Aubert?= Date: Fri, 15 Sep 2017 11:54:56 +0200 Subject: [PATCH] Do not use dot module to build column type query --- lib/cartodb/models/dataview/base.js | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/lib/cartodb/models/dataview/base.js b/lib/cartodb/models/dataview/base.js index 29069d37..fb5f520e 100644 --- a/lib/cartodb/models/dataview/base.js +++ b/lib/cartodb/models/dataview/base.js @@ -1,6 +1,3 @@ -var dot = require('dot'); -dot.templateSettings.strip = false; - function BaseDataview() {} module.exports = BaseDataview; @@ -43,15 +40,14 @@ var DATE_OIDS = { 1184: true }; -var columnTypeQueryTpl = dot.template( - 'SELECT pg_typeof({{=it.column}})::oid FROM ({{=it.query}}) _cdb_column_type limit 1' -); +var columnTypeQueryTpl = ctx => `SELECT pg_typeof(${ctx.column})::oid FROM (${ctx.query}) _cdb_column_type limit 1`; BaseDataview.prototype.getColumnType = function (psql, column, query, callback) { var readOnlyTransaction = true; var columnTypeQuery = columnTypeQueryTpl({ - column: column, query: query + column: column, + query: query }); psql.query(columnTypeQuery, function(err, result) {