-
-
Notifications
You must be signed in to change notification settings - Fork 4.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Discrepancy in docs vs typescript types for locks #11178
Comments
Having the same issue here. When I do something like: const user = await models.sequelize.transaction(async t => {
const contest = await models.Contest.findByPk(id, {
transaction: t,
lock: true,
});
// ...rest of the code, returns user at the end
}); I get |
Any updates? |
@aecorredor No, would you like to try to make a PR? |
@papb sure thing, I'll give it a shot, just wanted to make sure that it was indeed a bug in the types and not me doing something wrong. |
@aecorredor Ah, ok! Indeed looks like a bug. Thank you very much. I will fix the issue label |
This issue has been automatically marked as stale because it has been open for 14 days without activity. It will be closed if no further activity occurs within the next 14 days. If this is still an issue, just leave a comment or remove the "stale" label. 🙂 |
Looks like this was fixed by #11620 |
What are you doing?
I am attempting to lock a table when I perform a find query. The documentation seems to have a discrepancy in how these locks can be created, however the typescript types do not sync up
The following will produce a type error:
See below for all of the typescript warnings that also seem to be valid code as stated in the docs here and here
To Reproduce
Steps to reproduce the behavior:
MigrationLock
using typescriptlock: true
infindAll
What do you expect to happen?
I want to be able to have a type-safe find lock on a table
What is actually happening?
Typescript keeps yelling at me
Environment
Dialect:
Dialect library version: 10.4
Database version: 10.4
Sequelize version: 5.9.4
Node Version: v10.15.0
OS: OSX Mojave 10.14.5
If TypeScript related: TypeScript version: XXX
Tested with latest release:
The text was updated successfully, but these errors were encountered: