balderdashy / waterline-sequel

A SQL generator for use in Waterline Adapters
MIT License
16 stars 61 forks source link

fix for empty NOT IN () in WHERE clause #12

Open mikemorreale opened 10 years ago

mikemorreale commented 10 years ago

The following code gives an error for trying to do an empty NOT IN (), which is invalid SQL.

var list = [];
User.find().where({id: {not: list}}).exec(function (err, users) {
});

I added a small fix to use WHERE TRUE instead when this occurs.

mikermcneil commented 9 years ago

@mikemorreale Thank you- we're working on setting up a basic test suite for this module-- would you be interested in getting involved?

mikemorreale commented 9 years ago

Sure, I'd be happy to help out.