Repository navigation
Refactor/301 qbmapper - #304
Merged
Merged
Conversation
Covers every mapper method the app uses (find, search, insert, update, delete, and the per-project/per-user queries) on the real database, so the migration to QBMapper can be checked against the current behaviour on SQLite, MySQL/MariaDB and PostgreSQL. Refs #301 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015KJpM1wJdw3Uxw5p86uRBD
In 2023 (#210) the removed OCP\AppFramework\Db\Mapper was replaced by a copy of its old code (OldNextcloudMapper), aliased as CompatibleMapper. All mappers now extend Nextcloud's QBMapper and build their queries with the query builder, so the copy and the alias are gone. Behaviour stays the same: every public method keeps its name, arguments and results, including which lookups return null and which throw DoesNotExistException. The new integration tests pass unchanged on SQLite, MySQL/MariaDB and PostgreSQL, before and after. Details: - ProjectMapper::delete($id) clashed with QBMapper::delete(Entity) and is now deleteById($id). - TagMapper::allowedTags() no longer needs database-specific SQL for the current time; it uses time(). - Name searches escape % and _ in the search text, so they match literally. - ReportItemMapper only builds reports and isn't a table mapper; it is now a plain class using the query builder. - Removed code that could not work: WorkItem/WorkItemMapper (their table doesn't exist), WorkIntervalMapper::stopAllRunning() (invalid SQL) and ::findAllForWorkItem() (column doesn't exist), and the unused WorkIntervalMapper::findByName(). - The PHPStan bootstrap that mirrored the alias and the baseline entries for the old mapper code are removed. Fixes #301 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015KJpM1wJdw3Uxw5p86uRBD
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.
No description provided.