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

support for SELECT ... FOR UPDATE OF table_name #683

Closed
remvn opened this issue Sep 7, 2023 · 2 comments
Closed

support for SELECT ... FOR UPDATE OF table_name #683

remvn opened this issue Sep 7, 2023 · 2 comments
Labels
api Related to library's API enhancement New feature or request greenlit Ready for implementation mysql Related to MySQL postgres Related to PostgreSQL

Comments

@remvn
Copy link

remvn commented Sep 7, 2023

currently i can't find a way to add raw sql to SelectQueryBuilder

suggestion: maybe we can add a new parameter for table_name in SelectQueryBuilder.forUpdate() method

edit: my current workaround Playground Link

image

It would be nice if i can do some auto-complete and type-safe for table_name.

@remvn remvn changed the title support SELECT ... FOR UPDATE OF table_name support for SELECT ... FOR UPDATE OF table_name Sep 7, 2023
@koskimas
Copy link
Member

koskimas commented Sep 7, 2023

Yep, we should add an optional argument for those methods. It can be a single table name or an array of them.

@koskimas koskimas added enhancement New feature or request api Related to library's API greenlit Ready for implementation labels Sep 7, 2023
@igalklebanov igalklebanov added postgres Related to PostgreSQL mysql Related to MySQL labels Sep 22, 2023
@koskimas
Copy link
Member

koskimas commented Jan 2, 2024

Released in 0.27.1. You can now say

.forUpdate('person')
.forKeyShare('person')

or

.forUpdate(['person', 'pet'])
.forKeyShare(['person', 'pet'])

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api Related to library's API enhancement New feature or request greenlit Ready for implementation mysql Related to MySQL postgres Related to PostgreSQL
Projects
None yet
Development

No branches or pull requests

3 participants