Repository navigation
Conversation
The result table's right mouse menu item "Copy as SQL WHERE statement" offers a sub menu to choose the leading keyword WHERE, AND or OR. The chosen keyword is checked, remembered and shown in the menu item's text, e.g. "Copy as SQL AND statement". AND / OR allow to append the copied condition to an existing WHERE clause. When multiple rows are selected the ORed rows are bracketed, e.g. AND ((ID=1 AND NAME='Alice') OR (ID=2 AND NAME='Bob')) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01ALfFJ4FbFdmpAezKadmJjG
Author
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.



For squirrel-sql-client/squirrel-sql-code issue #101.
"Copy as SQL WHERE statement" in the result table's right mouse menu gets a hover submenu to choose the leading keyword: WHERE, AND or OR.
Props, so it survives restarts and applies to all result tabs) and renames the item, e.g. to Copy as SQL AND statement.When multiple rows are selected, AND/OR bracket the ORed rows so the snippet stays correct when appended to an existing WHERE clause:
WHERE A=1AND A=1WHERE (A=1 AND B='x')AND (A=1 AND B='x')WHERE A=1 OR A=3AND (A=1 OR A=3)WHERE (A=1 AND B='x')OR (A=2 AND B is null)AND ((A=1 AND B='x')OR (A=2 AND B is null))Screenshots
Changes
TableCopyWhereStatementCommand: new constructor overload taking the leading keyword. The old constructor defaults toWHERE.fw/gui/action/CopyWhereStatementMenu: aJMenuwith checkable WHERE/AND/OR items in aButtonGroup. It persists the choice and runs the copy when the parent item itself is clicked (aJMenudoesn't run an action on click by itself).TablePopupMenu: adds the menu in place of the old item and refreshes it inshowPopupMenu(...), because another result tab may have changed the keyword. A smallregisterShortcut(...)keeps the action's shortcut working, since aJMenucan't carry an accelerator.fw/gui/action/I18NStrings.properties: two new strings.Testing
antbuild succeeds on JDK 21. TheversionCheckertarget's hardcodedsource/target 1.7had to be bumped to 1.8 locally just to build; that change is not part of this PR.... where city is not nulland executed, it returned exactly those two rows.Written with AI assistance (Claude Code).
🤖 Generated with Claude Code
https://claude.ai/code/session_01ALfFJ4FbFdmpAezKadmJjG