Skip to content

refactor(Setup/AbstractDatabase): improve structure and maintainability#58412

Draft
joshtrichards wants to merge 15 commits intomasterfrom
jtr/refactor-setup-AbstractDatabase
Draft

refactor(Setup/AbstractDatabase): improve structure and maintainability#58412
joshtrichards wants to merge 15 commits intomasterfrom
jtr/refactor-setup-AbstractDatabase

Conversation

@joshtrichards
Copy link
Member

  • Resolves: #

Summary

  • Split up validate() logic
    • Improved readability
    • Easier child class customization
      • e.g. Setup/OCI override (to avoid the dot check) is streamlined
  • Eliminate magic property $this->dbprettyname
    • Makes the undefined property explicit and required (less psalm baseline noise)
    • Updated in all child classes
  • Split up initialize() logic
    • Improved readability
    • Easier child class customization
  • Split up connect() logic / extracted port and socket parsing to a helper function
    • Improved readability
    • Added helpful inline comments
    • Simplified primary/replica param merging (same outcome)
  • Improved readability and logging in runMigrations()

Some misc minor robustness / modernization throughout.

Easiest to review commit-by-commit

TODO

  • ...

Checklist

Also:

- Switch to more modern str_contains()
- Tidy up code formatting a bit

Signed-off-by: Josh <[email protected]>
- Child classes can override specific validation rules more selectively (e.g. OCI override becomes simpler to avoid the dot check)
- Improved code readability

Signed-off-by: Josh <[email protected]>
- Makes the undefined property explicit and required (less psalm baseline noise)
- Forces child classes to implement it
- Better type safety

Signed-off-by: Josh <[email protected]>
And canonicalize "SQLite" properly

Signed-off-by: Josh <[email protected]>
- Improved readability
- Easier child class customization

Also added for certain config keys: a couple clarifying comments and additional error checking

Signed-off-by: Josh <[email protected]>
Also:

- add some helpful inline comments
- simplify primary/replica param merging (same outcome)

Signed-off-by: Josh <[email protected]>
@joshtrichards joshtrichards added feature: install and update ♻️ refactor Refactor code (not a bug fix, not a feature just refactoring) feature: database Database related DB labels Feb 19, 2026
@joshtrichards joshtrichards added this to the Nextcloud 34 milestone Feb 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature: database Database related DB feature: install and update ♻️ refactor Refactor code (not a bug fix, not a feature just refactoring)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

Comments