ccgus/fmdb — pull request #180 by groue (2013-08-23 11:08:51+00:00)
Title: Data Sanitization of enumerable arguments in [FMDatabase executeQuery:withArgumentsInArray:]

Hi,

This commit provides data sanitization of NSArray, NSSet and NSOrderedSet arguments in [FMDatabase executeQuery:withArgumentsInArray:], and solves two problems:

1. FMDB 2.1 requires users to provide as many question marks in the query as there are elements, and this is tedious when the enumerable object has a variable length.
2. FMDB 2.1 surprises users who do not know well the internals of sqlite, and expect enumerables to be transparently expanded, as in famous ORMs such as ActiveRecord.

For example:

```objc
// After
ids = @[@1, @2, @3];
[db executeQuery:@"SELECT * FROM table WHERE id IN (?)" withArgumentsInArray:@[ids]]
```

Note the single question mark bound to an NSArray object.

There are a few caveats, though. They are documented in the method implementation (see attached code).

I hope you'll find this patch useful, and that we'll improve it together.