camshaft quote_columns

This commit is contained in:
Raúl Marín
2019-11-25 13:17:09 +01:00
parent 69afee61e0
commit f545b4d002
5 changed files with 53 additions and 119 deletions
@@ -179,6 +179,16 @@ AnalysisMapConfigAdapter.prototype.getMapConfig = function (user, requestMapConf
});
};
function stripQuotes(columnName) {
const quotedName = columnName.length > 2 && columnName[0] === '"' && columnName[columnName.length - 1] === '"';
if (quotedName)
{
return columnName.substring(1, columnName.length - 1);
}
return columnName;
}
var SKIP_COLUMNS = {
the_geom: true,
the_geom_webmercator: true
@@ -186,7 +196,7 @@ var SKIP_COLUMNS = {
function skipColumns (columnNames) {
return columnNames
.filter(function (columnName) { return !SKIP_COLUMNS[columnName]; });
.filter(function (columnName) { return !SKIP_COLUMNS[stripQuotes(columnName)]; });
}
var wrappedQueryTpl = dot.template([