You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using lock mode for_no_key_update in find method like this: repository.find({ lock: { mode: 'for_no_key_update' } })
Output query does not have lock.
The reason is missing 'for_no_key_update' check in FindOptionsUtils.ts
FOR NO KEY UPDATE was introduced in typeorm 0.2.25 but the relevant query
part was never added due to missing check in FindOptionUtils
Closes: typeorm#7717
FOR NO KEY UPDATE was introduced in typeorm 0.2.25 but the relevant query
part was never added due to missing check in FindOptionUtils
Closes: typeorm#7717
Issue Description
When using lock mode for_no_key_update in find method like this:
repository.find({ lock: { mode: 'for_no_key_update' } })
Output query does not have lock.
The reason is missing 'for_no_key_update' check in FindOptionsUtils.ts
typeorm/src/find-options/FindOptionsUtils.ts
Line 184 in beea2e1
Expected Behavior
In case of pg driver, I expect adding
FOR NO KEY UPDATE
to the end ofSELECT ...
, same as using lock method for QueryBuilder.Actual Behavior
Lock is not added because of skipping it on repository level and missing on query builder error.
So resulting query is simple select.
Steps to Reproduce
`repository.find({ lock: { mode: 'for_no_key_update' } })`
My Environment
Additional Context
Relevant Database Driver(s)
aurora-data-api
aurora-data-api-pg
better-sqlite3
cockroachdb
cordova
expo
mongodb
mysql
nativescript
oracle
postgres
react-native
sap
sqlite
sqlite-abstract
sqljs
sqlserver
Are you willing to resolve this issue by submitting a Pull Request?
The text was updated successfully, but these errors were encountered: