feat: bookmarks search#968
Conversation
Signed-off-by: Abhishek Dhiman <abhi2002dhiman@gmail.com>
|
@dhimanAbhi this looks like a duplicate of #973, is that intended or did you mean to only open that one? |
renezander030
left a comment
There was a problem hiding this comment.
Hi @dhimanAbhi,
Three things from reading the diff:
-
Stray backtick in the
Shortdescription:Short: "Search saved bookmarks\",— the trailing backtick will show up in--help` output. -
The acceptance criteria on #959 calls for tests covering name match, query match, no match, and JSON output. The current diff doesn't add any. The other CLI commands in
cli/cmd/have programmatic tests inprogrammatic_commands_test.gothat you could mirror. -
strings.ReplaceAll(value.Query, "\n", " ")is applied to the row before passing toWriteQueryResult, which means the JSON output also returns the newlines-collapsed query rather than the original SQL. Worth keeping the originalvalue.Queryin the row and letting the table renderer be the one that flattens whitespace for display only.
Also re modelorona's comment about #973 being a duplicate — if that one is intended as the canonical PR it might be worth closing one of them to unblock the review.
Thanks for the work on this.
Related Issue
Closes #959
What does this PR do?
Adds a new whodb-cli bookmarks search [pattern] command to filter saved bookmarks by name and SQL query text.
Why?
Currently, users must scan all bookmarks manually using list. This becomes inefficient as the number of bookmarks grows. This feature enables quick lookup by name or query content.
How it works
The user can use this command by passing an arguement of a bookmark's name or query. The command filters from existing bookmarks and returns results.
Usage
whodb-cli bookmarks search patternHow was this tested?
Manual testing:
Screenshots / recordings
Checklist