Skip to content
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

Add support for FOR KEY SHARE lock mode #8878

Closed
urossmolnik opened this issue Apr 12, 2022 · 0 comments · Fixed by #8879
Closed

Add support for FOR KEY SHARE lock mode #8878

urossmolnik opened this issue Apr 12, 2022 · 0 comments · Fixed by #8879

Comments

@urossmolnik
Copy link
Contributor

Feature Description

Add support for FOR KEY SHARE lock mode - postgres only.

The Problem

In rare occasions FOR KEY SHARE lock is needed on row. Currently TypeORM does not support this kind of lock.

The Solution

New lockMode: for_key_share. Lock would be applied only for driver type postgres. Otherwise LockNotSupportedOnGivenDriverError error would be thrown.

Considered Alternatives

n/a

Additional Context

Postgres documentation at https://www.postgresql.org/docs/12/explicit-locking.html

Relevant Database Driver(s)

DB Type Relevant
aurora-mysql no
aurora-postgres yes
better-sqlite3 no
cockroachdb no
cordova no
expo no
mongodb no
mysql no
nativescript no
oracle no
postgres yes
react-native no
sap no
sqlite no
sqlite-abstract no
sqljs no
sqlserver no

Are you willing to resolve this issue by submitting a Pull Request?

Yes.

  • ✅ Yes, I have the time, and I know how to start.
  • ✖️ Yes, I have the time, but I don't know how to start. I would need guidance.
  • ✖️ No, I don’t have the time, but I can support (using donations) development.
  • ✖️ No, I don’t have the time and I’m okay to wait for the community / maintainers to resolve this issue.
urossmolnik added a commit to urossmolnik/typeorm that referenced this issue Apr 12, 2022
…iver

Adds support for new lock mode `for_key_share` - generating FOR KEY SHARE lock. Postgres specific.

Closes: typeorm#8878
urossmolnik added a commit to urossmolnik/typeorm that referenced this issue Apr 12, 2022
…iver

Adds support for new lock mode `for_key_share` - generating FOR KEY SHARE lock. Postgres specific.

Closes: typeorm#8878
urossmolnik added a commit to urossmolnik/typeorm that referenced this issue Apr 12, 2022
…iver

Adds support for new lock mode `for_key_share` - generating FOR KEY SHARE lock. Postgres specific.

Closes: typeorm#8878
pleerock pushed a commit that referenced this issue Apr 12, 2022
…iver (#8879)

Adds support for new lock mode `for_key_share` - generating FOR KEY SHARE lock. Postgres specific.

Closes: #8878
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant