Don't add a WHERE if there are no constraints
This commit is contained in:
parent
c33bc70756
commit
cdc7ae6c82
|
@ -241,6 +241,9 @@ MySQL.prototype.all = function all(model, filter, callback) {
|
|||
cs.push(keyEscaped + ' = ' + val);
|
||||
}
|
||||
});
|
||||
if (cs.length === 0) {
|
||||
return '';
|
||||
}
|
||||
return 'WHERE ' + cs.join(' AND ');
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue