Skip to content

Add FOR clause for query #967

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

Merged
merged 25 commits into from
May 6, 2025
Merged

Add FOR clause for query #967

merged 25 commits into from
May 6, 2025

Conversation

vjik
Copy link
Member

@vjik vjik commented May 1, 2025

Q A
Is bugfix?
New feature? ✔️
Breaks BC? ✔️
Fix #813

Related PRs:

@vjik vjik added the status:under development Someone is working on a pull request. label May 1, 2025
Copy link

codecov bot commented May 1, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 99.19%. Comparing base (c497fa3) to head (0690aee).
Report is 2 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff            @@
##             master     #967   +/-   ##
=========================================
  Coverage     99.19%   99.19%           
- Complexity     1600     1611   +11     
=========================================
  Files            98       98           
  Lines          3953     3980   +27     
=========================================
+ Hits           3921     3948   +27     
  Misses           32       32           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Member

@Tigrov Tigrov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In MSSQL it is deprecated
https://learn.microsoft.com/en-us/sql/odbc/reference/appendixes/processing-select-for-update-statements?view=sql-server-ver16

MSSQL has different lock mechanism
SELECT * FROM table_name WITH (UPDLOCK) WHERE ...
https://learn.microsoft.com/en-us/sql/t-sql/queries/hints-transact-sql-table?view=sql-server-ver16

We can still try SELECT FOR UPDATE while it works

@Tigrov
Copy link
Member

Tigrov commented May 2, 2025

MSSQL supports FOR clause, see:

There are only

  • FOR BROWSE
  • FOR XML
  • FOR JSON

But no FOR UPDATE

@vjik
Copy link
Member Author

vjik commented May 2, 2025

But no FOR UPDATE

You're right.

Currently SELECT ... FOR UPDATE usage in MSSQL required special settings of connection (docs), right?

May be add "not supported" exception in forUpdate() to mssql?

@Tigrov
Copy link
Member

Tigrov commented May 3, 2025

May be add "not supported" exception in forUpdate() to mssql?

Yes, for now can be marked as "not supported".

@vjik
Copy link
Member Author

vjik commented May 4, 2025

May be add "not supported" exception in forUpdate() to mssql?

Yes, for now can be marked as "not supported".

forUpdate() method is in Query class. So we can't check it in MSSQL driver code. Maybe keep it as is?

vjik and others added 2 commits May 5, 2025 11:27
Co-authored-by: Sergei Tigrov <rrr-r@ya.ru>
@vjik vjik added status:code review The pull request needs review. and removed status:under development Someone is working on a pull request. labels May 5, 2025
@vjik vjik requested a review from a team May 5, 2025 08:37
Copy link
Member

@rustamwin rustamwin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Co-authored-by: Sergei Tigrov <rrr-r@ya.ru>
Co-authored-by: Sergei Tigrov <rrr-r@ya.ru>
@vjik vjik merged commit 84a5b9d into master May 6, 2025
67 of 68 checks passed
@vjik vjik deleted the for-update branch May 6, 2025 10:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status:code review The pull request needs review.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add ability to create SELECT with FOR UPDATE
4 participants