fix where clause generation

This commit is contained in:
Sven Klemm
2018-07-06 10:56:47 +02:00
parent 7600c6efcb
commit 6143924ec6

View File

@ -194,7 +194,7 @@ export default class PostgresQuery {
query += ', ' + selectText; query += ', ' + selectText;
} }
query += ' FROM ' + target.schema + '.' + target.table + ' WHERE '; query += ' FROM ' + target.schema + '.' + target.table;
var conditions = _.map(target.where, (tag, index) => { var conditions = _.map(target.where, (tag, index) => {
switch (tag.type) { switch (tag.type) {
case 'macro': case 'macro':
@ -207,7 +207,7 @@ export default class PostgresQuery {
}); });
if (conditions.length > 0) { if (conditions.length > 0) {
query += conditions.join(' AND '); query += ' WHERE ' + conditions.join(' AND ');
} }
var groupBySection = ''; var groupBySection = '';