Repository navigation
Adding skiplocked support - #9197
Conversation
66597e1 to
dc700c5
Compare
|
You can add integration tests in this file You can add an example of this option here If you want you can improve docs further as there is no dedicated section for locks, a subsection about locks in transaction docs will be really nice, but not required to merge this PR |
|
Great thanks. I'll take a look this weekend. |
b095143 to
26df8a5
Compare
|
Added tests and some simple docs |
| return User.findAll({ | ||
| limit: 1, | ||
| lock: true, | ||
| skipLocked: true, |
There was a problem hiding this comment.
In first transaction there is no need to skip locks, I assume all rows are free at this time.
| return Promise.all([ | ||
| t1.commit(), | ||
| t2.commit() | ||
| ]) |
There was a problem hiding this comment.
Missing semi colon failing tests
|
You need to add a skip lock example here |
| For methods that take values, like `.create`, `.update()`, `.updateAttributes()` etc. `transaction` should be passed to the option in the second argument. | ||
| If unsure, refer to the API documentation for the method you are using to be sure of the signature. | ||
|
|
||
| ## Locks |
There was a problem hiding this comment.
Can improve this by adding more examples from here
sushantdhiman
left a comment
There was a problem hiding this comment.
A few changes otherwise looks good
|
@sushantdhiman Pushed some changes for the above |
| username: Support.Sequelize.STRING, | ||
| awesome: Support.Sequelize.BOOLEAN | ||
| }), | ||
| self = this; |
There was a problem hiding this comment.
remove self = this, it should not be required with arrow functions
sushantdhiman
left a comment
There was a problem hiding this comment.
Tests for MySQL case are failing for incorrect SQL
|
Okay cool, will have a look. Looks like skip locked is only available in MYSQL 8. I'll remove for mysql and fix up tomorrow. |
9a34b60 to
554783b
Compare
|
@sushantdhiman Removed support for mysql |
This was added in sequelize#9197 but not added to the docs for `findAll`.
This was added in sequelize#9197 but not added to the docs for `findAll`.
Pull Request check-list
Please make sure to review and check all of these items:
npm run testornpm run test-DIALECTpass with this change (including linting)?Description of change
#8910
Adding SKIP LOCKED to lock queries.
Where should I write tests for this?
Where would you like the docs?