MarrLiss/backbone-websql — pull request #10 by prust (2013-03-26 20:31:01+00:00)
Title: Added support for explicit transactions

The Web SQL Database implementation on the iPhone is very slow if every `INSERT` is done in its own transaction. This pull request allows the client code to specify a `transaction` property on the `options` object so that multiple `save()`s are done in a single transaction, like this:

```javascript
db.transaction(function (tx) {
model_1.save(null, {'transaction': tx});
model_2.save(null, {'transaction': tx});
model_3.save(null, {'transaction': tx});
});
```

This is much faster and also allows client code to group related or interdependent database operations so that they succeed or fail together.