PR style fixes

This commit is contained in:
IagoLast
2018-06-05 08:44:20 +02:00
parent 8ec2b35557
commit 2ee6c8487d
2 changed files with 3 additions and 4 deletions

View File

@@ -18,7 +18,7 @@ class VectorMapConfigAdapter {
return callback(null, requestMapConfig);
}
if (requestMapConfig.layers.lenght > 1) {
if (requestMapConfig.layers.length > 1) {
return callback(new Error('Get column types for multiple vector layers is not implemented'));
}
@@ -43,11 +43,10 @@ class VectorMapConfigAdapter {
if (err) {
return reject(err);
}
const query = `SELECT * FROM (${originalQuery}) _cdb_column_type limit 0`;
const query = queryUtils.getQueryLimited(originalQuery, 0);
queryUtils.queryPromise(connection, query)
.then(resolve)
.catch(reject);
// TODO release pgConnection
});
});
}

View File

@@ -31,7 +31,7 @@ function _isDateType(field) {
* @param {string} column - The name of the date column
*/
function _castColumnToEpoch(columnName) {
return `date_part('epoch', ${columnName}) as ${columnName}`;
return `date_part('epoch', ${columnName}) as "${columnName}"`;
}
module.exports = {