sequelize/sequelize — pull request #569 by optilude (2013-04-27 21:46:33+00:00)
Title: Support for bulk insert, update and delete operations at the DAOFactory level

See Sequelize issue #559

This change adds three methods to each DAO factory:

* `bulkCreate()` can create multiple records as a single `INSERT` statement with multiple `VALUES` clauses
* `bulkDelete()` can delete multiple records matching a `WHERE` clause (the standard delete operation is tied to a DAO's `destroy()` method and has a `LIMIT 1` appended for MySQL and Postgres)
* `bulkUpdate()` can update multiple records matching a `WHERE` clause with values provided in a hash (the standard update operation is tied to a DAO's `save()` method)

There are tests (Buster tests for all the new stuff, and some additional clauses in the Jasmine tests for the query generators) and all tests pass for me (note that there seems to be a flapping test related to a Postgres uniqueness constraint, but I don't think it has anything to do with this change: I sometimes get "error: duplicate key value violates unique constraint "pg_type_typname_nsp_index" when running `npm test`, but can't replicate when running `test-buster-postgres-native` or `test-buster-postgres`).

I'm happy to write some documentation for these features if the pull request accepted. I may need a bit of help understanding how the SequelizeJS.com documentation is actually maintained, though. There are internal comments in the code to explain the new methods at the `DAOFactory` level at least.