Migrate to pomelo MySQL provider#124
Merged
richardscull merged 6 commits intoJun 8, 2026
Merged
Conversation
… get replay controller
richardscull
commented
Jun 8, 2026
richardscull
commented
Jun 8, 2026
Comment on lines
90
to
+99
| public async Task<IActionResult> GetReplay( | ||
| [FromQuery(Name = "u")] string username, | ||
| [FromQuery(Name = "h")] string passhash, | ||
| [FromQuery(Name = "c")] int scoreId, CancellationToken ct = default | ||
| ) | ||
| { | ||
| var session = await sessions.TryGetSessionAsync(username, passhash); | ||
| if (session == null) | ||
| return Ok("error: pass"); | ||
|
|
Member
Author
There was a problem hiding this comment.
Non related change, but we also put the replay reading under authorization, as was intended.
richardscull
commented
Jun 8, 2026
Comment on lines
+331
to
336
| .FilterValidScores() | ||
| .FilterPassedScoreableScores() | ||
| .Where(s => s.UserId == userId && s.BeatmapHash == beatmapHash && s.GameMode == gameMode && s.Id != excludeId) | ||
| .AsNoTracking() | ||
| .ForUpdate() | ||
| .ToListAsync(ct); |
Member
Author
There was a problem hiding this comment.
Generates the same SQL from my testing, with only addition to checking user account status.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
We are migrating from Oracle
MySql.EntityFrameworkCoreprovider toPomelo.EntityFrameworkCore.MySql.One of the main reasons to do is the performance, since the Pomelo's provider using MySqlConnector which is far more superior to the Oracle's MySQL.Data.
I also added
EntityFrameworkCore.Locking.MySqpackage, which is more native way to add DB locking for rows in EF Core, without writing custom raw query. Props to mnbuhl.MySqlConnector is also more sensitive to any DB connections running in sync, this is why there is multiple code changes with fixing this.
As non related change, we also now check user authorisation before streaming replay data in osu! client endpoint.