-
-
Notifications
You must be signed in to change notification settings - Fork 57
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
FEAT: Improve behavior of search /
function on tree
#124
base: main
Are you sure you want to change the base?
FEAT: Improve behavior of search /
function on tree
#124
Conversation
If there are no selected database (highlighted db node should be expanded): function will search on database names only else, the function will search within the tables of the selected database
Found a bug that I'm not sure how to fix. At first glance, i think has to be related |
Thoughts on this? @jorgerojas26 Thanks |
var searchStartNode *tview.TreeNode | ||
if currNode != nil && currNode.IsExpanded() { | ||
// search between tables if theres a curentdatabase selected | ||
searchStartNode = currNode | ||
} else { | ||
// if there's no current database selected, search within the database names only | ||
searchStartNode = rootNode | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
var searchStartNode *tview.TreeNode | |
if currNode != nil && currNode.IsExpanded() { | |
// search between tables if theres a curentdatabase selected | |
searchStartNode = currNode | |
} else { | |
// if there's no current database selected, search within the database names only | |
searchStartNode = rootNode | |
} | |
// search within the database names only by default | |
searchStartNode := rootNode | |
if currNode != nil && currNode.IsExpanded() { | |
// search between tables if there is a database selected | |
searchStartNode = currNode | |
} |
/
) within a specific database #121Current Behavior
Running the search command
/
will expand all databases and find all possibilities of tables within the whole server, throughout all databases.The issue arises when there are multple instances of table names within multiple databases. it becomes hard to determine which database the focused table is from since the database is expanded, and if there are 20+ tables you cannot see the DB name unless you move up.
Implemented Behavior
To mark a database as "selected" It has to be the
currNode
and it should be expanded.I believe this is a better implementation since its most common to search a table within a specific database, rather than all the databases.
I can also include in this PR to move the command that "searches on all databases" to
CTRL + /
.