brianc/node-sql — pull request #165 by martinandert (2014-03-11 09:43:38+00:00)
Title: Properly handle edge cases for IN / NOT IN operators

This fixes some things that are broken with the current implementation of the IN and NOT IN operators.

**Empty Arrays**

Before:

```js
where(post.id.in( [] ))
// => WHERE ("post"."id" IN ()) <= syntax error
```

After:

```js
where(post.id.in( [] ))
// => WHERE (1=0)
```

**Arrays containing `null` values**

Before:

```js
where(post.id.in( [1, 2, null] ))
// => WHERE ("post"."id" IN ($1, $2, $3))
```

After:

```js
where(post.id.in( [1, 2, null] ))
// => WHERE ("post"."id" IN ($1, $2) OR "post"."id" IS NULL)
```

My fix goes in line with how Arel handles these special cases.

This also addresses #137.