Skip to content

feat(mysql): add support for skipLocked#18225

Open
dominikko-monday wants to merge 1 commit into
sequelize:mainfrom
dominikko-monday:fix/mysql-skip-locked
Open

feat(mysql): add support for skipLocked#18225
dominikko-monday wants to merge 1 commit into
sequelize:mainfrom
dominikko-monday:fix/mysql-skip-locked

Conversation

@dominikko-monday
Copy link
Copy Markdown

@dominikko-monday dominikko-monday commented May 26, 2026

Pull Request Checklist

  • Have you added new tests to prevent regressions?
  • If a documentation update is necessary, have you opened a PR to the documentation repository?
  • Did you update the typescript typings accordingly (if applicable)?
  • Does the description below contain a link to an existing issue (Closes #[issue]) or a description of the issue you are solving?
  • Does the name of your PR follow our conventions?

Description of Changes

Github Issue Link: #15589

MySQL 8.0+ supports SKIP LOCKED syntax (introduced in MySQL 8.0.1), but the Sequelize MySQL
dialect does not declare support for it. This PR adds skipLocked: true to the MySQL dialect's
supported features.

Without this, using skipLocked: true in a query silently ignores the option on MySQL.

Summary by CodeRabbit

  • New Features
    • MySQL now supports SKIP LOCKED functionality for improved query execution and concurrency handling. This enables queries to skip rows currently locked by other transactions, reducing lock contention and improving performance in high-load scenarios where multiple operations frequently access the same data simultaneously.

Review Change Stack

@dominikko-monday dominikko-monday requested a review from a team as a code owner May 26, 2026 08:40
@dominikko-monday dominikko-monday requested review from ephys and sdepold May 26, 2026 08:40
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 26, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 9d13040f-8070-4aad-a562-0a042fe0be5b

📥 Commits

Reviewing files that changed from the base of the PR and between 8260c29 and 6080f57.

📒 Files selected for processing (1)
  • packages/mysql/src/dialect.ts

📝 Walkthrough

Walkthrough

The MySQL dialect support matrix is updated to enable the skipLocked capability, allowing MySQL to support the SKIP LOCKED clause in query operations.

Changes

MySQL skipLocked Support

Layer / File(s) Summary
MySQL skipLocked capability flag
packages/mysql/src/dialect.ts
The skipLocked: true option is added to the MySqlDialect extendSupport configuration, enabling the skipLocked capability for MySQL.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Poem

🐰 A MySQL whisper, soft and bright,
"Skip locked rows!" the rabbit cites,
One line of code, a simple feat,
Makes concurrency swift and neat!
hops away contentedly

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: enabling skipLocked support in the MySQL dialect, which matches the primary objective of the pull request.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant