不要怂,就是干,撸起袖子干!

Commit 4c1944cb by Ruben Bridgewater

Update transaction lock docs for version 3.0

1 parent a8295675
Showing with 13 additions and 10 deletions
...@@ -53,24 +53,27 @@ Transaction.ISOLATION_LEVELS = { ...@@ -53,24 +53,27 @@ Transaction.ISOLATION_LEVELS = {
* *
* ```js * ```js
* t1 // is a transaction * t1 // is a transaction
* t1.LOCK.UPDATE,
* t1.LOCK.SHARE,
* t1.LOCK.KEY_SHARE, // Postgres 9.3+ only
* t1.LOCK.NO_KEY_UPDATE // Postgres 9.3+ only
* ```
*
* Usage:
* ```js
* t1 // is a transaction
* Model.findAll({ * Model.findAll({
* where: ... * where: ...,
* }, {
* transaction: t1, * transaction: t1,
* lock: t1.LOCK.UPDATE, * lock: t1.LOCK...
* lock: t1.LOCK.SHARE,
* lock: t1.LOCK.KEY_SHARE, // Postgres 9.3+ only
* lock: t1.LOCK.NO_KEY_UPDATE // Postgres 9.3+ only
* }); * });
* ``` * ```
* *
* Postgres also supports specific locks while eager loading by using OF. * Postgres also supports specific locks while eager loading by using OF:
*
* ```js * ```js
* UserModel.findAll({ * UserModel.findAll({
* where: ..., * where: ...,
* include: [TaskModel, ...] * include: [TaskModel, ...],
* }, {
* transaction: t1, * transaction: t1,
* lock: { * lock: {
* level: t1.LOCK..., * level: t1.LOCK...,
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!