stephencelis/SQLite.swift — pull request #31 by kasrak (2014-12-17 22:47:16+00:00)
Title: Allow values to insert to be passed as array of setters

Hello!

It can be helpful to build up the setters for a query dynamically. If Swift supported splatting, then the existing `insert` could be used (e.g. `insert(*[name <- "Alice", email <- "alice@mac.com"])`), but it doesn't (https://devforums.apple.com/message/970958).

This diff lets the columns to be built up dynamically. For example:

var values = [name <- "Alice"]

if shouldSetEmail {
values.append(email <- "alice@mac.com")
}

if let insertedID = users.insert(values) {
...
}

If you think this is a good idea, `update` should also be changed to allow an array of setters.