Refactoring of getDbInfo and getTablesFull - #20387
Draft
kamil-tekiela wants to merge 12 commits into
Draft
Conversation
Add unit tests for the previously untested paths of getDbInfo(): sort name mapping (including descending order and unknown sort columns), the tbl_group and tbl_type filters, and MaxTableList paging. Refactor getDbInfo() into three flat branches, replacing the string|false $groupWithSeparator juggling and the duplicated string checks. The sort name is now mapped with a match expression. The paging position is passed as an explicit parameter instead of being read from a private field, and the total table count is always returned as an int instead of int|null, so the caller no longer needs a fallback count. Signed-off-by: Kamil Tekiela <tekiela246@gmail.com> Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com> Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Clamp negative pos parameters to 0 in getTableListPosition(); a negative value used to be stored in the session and end up as a negative array_slice() offset or an invalid negative SQL OFFSET. Redirect to the last page when the position is exactly equal to the total number of tables: such a page is empty, but the previous check only redirected when the position was strictly greater, rendering an empty table list for a non-empty database. Signed-off-by: Kamil Tekiela <tekiela246@gmail.com> Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com> Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
kamil-tekiela
force-pushed
the
Refactoring-of-getDbInfo-and-getTablesFull
branch
from
July 20, 2026 14:08
027f5c8 to
6ce9836
Compare
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com> Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
kamil-tekiela
force-pushed
the
Refactoring-of-getDbInfo-and-getTablesFull
branch
from
July 20, 2026 14:16
6ce9836 to
f049395
Compare
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.
I have worked on this PR together with Claude Fable.
This PR aims to refactor and fix multiple issues concerning table listings. Some of the issues fixed:
Claude has added some unit tests which I believe were missing before. I've built my work on top of the refactoring that Claude offered.