Skip to content

refactor(setup): Untangle the collision-avoidance loops for database user creation (MySQL and PostgreSQL)#59094

Open
joshtrichards wants to merge 2 commits intomasterfrom
jtr/refactor-setup-collission-avoidance
Open

refactor(setup): Untangle the collision-avoidance loops for database user creation (MySQL and PostgreSQL)#59094
joshtrichards wants to merge 2 commits intomasterfrom
jtr/refactor-setup-collission-avoidance

Conversation

@joshtrichards
Copy link
Copy Markdown
Member

@joshtrichards joshtrichards commented Mar 20, 2026

  • Resolves: #

Summary

  • Untangles the collision-avoidance loops for database user creation.
  • extract userExists() and findAvailableUsername() helpers for unity between MySQL and PostgreSQL
  • userExists() now takes a $username parameter instead of implicitly reading from $this->dbUser, avoiding unnecessary mutation in findAvailableUsername() and pulling assignments out of loop bodies for improved readability.
  • Brings additional consistency to these two DB Setup classes, making future refactors easier.

Related: #59092

TODO

  • ...

Checklist

AI (if applicable)

  • The content of this PR was partly or fully generated using AI

…() helpers

Signed-off-by: Josh <josh.t.richards@gmail.com>
…ame() helper

Signed-off-by: Josh <josh.t.richards@gmail.com>
@joshtrichards joshtrichards added this to the Nextcloud 34 milestone Mar 20, 2026
@joshtrichards joshtrichards added feature: install and update technical debt 🧱 🤔🚀 ♻️ refactor Refactor code (not a bug fix, not a feature just refactoring) feature: database Database related DB 3. to review Waiting for reviews labels Mar 20, 2026
@joshtrichards joshtrichards marked this pull request as ready for review March 20, 2026 14:32
@joshtrichards joshtrichards requested a review from a team as a code owner March 20, 2026 14:32
@joshtrichards joshtrichards requested review from ArtificialOwl, CarlSchwan, leftybournes, nickvergessen and provokateurin and removed request for a team March 20, 2026 14:32
@joshtrichards joshtrichards changed the title refactor(setup): extract userExists() and findAvailableUsername() helpers for MySQL and PostgreSQL refactor(setup): Untangles the collision-avoidance loops for database user creation (MySQL and PostgreSQL) Mar 21, 2026
@joshtrichards joshtrichards changed the title refactor(setup): Untangles the collision-avoidance loops for database user creation (MySQL and PostgreSQL) refactor(setup): Untangle the collision-avoidance loops for database user creation (MySQL and PostgreSQL) Mar 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

3. to review Waiting for reviews feature: database Database related DB feature: install and update ♻️ refactor Refactor code (not a bug fix, not a feature just refactoring) technical debt 🧱 🤔🚀

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant