不要怂,就是干,撸起袖子干!

Commit 30ad8c19 by Sascha Depold

Merge branch 'terraflubb-nowhere_is_empty'

2 parents ea3c1872 fa6112f4
......@@ -416,7 +416,7 @@ module.exports = (function() {
result = Utils.format(smth)
}
return result
return result ? result : '1=1'
},
hashToWhereConditions: function(hash) {
......
......@@ -166,6 +166,26 @@ describe('QueryGenerator', function() {
arguments: ['myTable', {offset: 2}],
expectation: "SELECT * FROM `myTable`;",
context: QueryGenerator
}, {
title: 'multiple where arguments',
arguments: ['myTable', {where: {boat: 'canoe', weather: 'cold'}}],
expectation: "SELECT * FROM `myTable` WHERE `myTable`.`boat`='canoe' AND `myTable`.`weather`='cold';",
context: QueryGenerator
}, {
title: 'no where arguments (object)',
arguments: ['myTable', {where: {}}],
expectation: "SELECT * FROM `myTable` WHERE 1=1;",
context: QueryGenerator
}, {
title: 'no where arguments (string)',
arguments: ['myTable', {where: ''}],
expectation: "SELECT * FROM `myTable` WHERE 1=1;",
context: QueryGenerator
}, {
title: 'no where arguments (null)',
arguments: ['myTable', {where: null}],
expectation: "SELECT * FROM `myTable` WHERE 1=1;",
context: QueryGenerator
}
],
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!