Skip to content

Add query bookmarks and saved queries library#26

Open
muk2 wants to merge 1 commit intomainfrom
feature/issue-18-query-bookmarks
Open

Add query bookmarks and saved queries library#26
muk2 wants to merge 1 commit intomainfrom
feature/issue-18-query-bookmarks

Conversation

@muk2
Copy link
Owner

@muk2 muk2 commented Feb 18, 2026

Summary

Implements Issue #18 — a query bookmark system for saving, browsing, and loading frequently used SQL queries.

  • Ctrl+Shift+S saves the current editor content as a bookmark with name, description, and optional tags
  • Ctrl+Shift+O opens a searchable picker to browse and load saved queries
  • Search filters by name, description, tags, and query content
  • Ships with 6 built-in PostgreSQL admin snippets: table sizes, running queries, index usage stats, unused indexes, lock monitoring, cache hit ratio
  • User bookmarks persist to ~/.config/pgrsql/bookmarks.json
  • Delete key removes user bookmarks (built-in snippets cannot be deleted)

Changes

File Changes
src/bookmarks.rs New module: SavedQuery struct, load_bookmarks(), save_bookmarks(), built_in_snippets(), 6 unit tests
src/main.rs Added mod bookmarks
src/ui/app.rs Added Focus::BookmarkPicker/BookmarkSave, BookmarkPickerState, BookmarkSaveState, filtered_bookmarks(), picker and save input handlers, Ctrl+Shift+S/O keybindings
src/ui/components.rs Added draw_bookmark_picker(), draw_bookmark_preview(), draw_bookmark_save(), updated help overlay

Test plan

  • All 130 tests pass (124 existing + 6 new)
  • cargo clippy clean
  • cargo fmt clean
  • Manual test: Ctrl+Shift+S opens save dialog, fill name/description/tags, Enter saves
  • Manual test: Ctrl+Shift+O opens picker with built-in snippets
  • Manual test: Type in search field to filter bookmarks
  • Manual test: Enter loads selected bookmark into editor
  • Manual test: Delete removes user bookmarks (not built-ins)

🤖 Generated with Claude Code

Implements a bookmark system for saving and recalling SQL queries.
Ctrl+Shift+S saves the current editor content as a bookmark with name,
description, and tags. Ctrl+Shift+O opens a searchable picker to browse
and load saved queries. Ships with 6 built-in PostgreSQL admin snippets
(table sizes, running queries, index usage, etc.). User bookmarks persist
to ~/.config/pgrsql/bookmarks.json.

Closes #18

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant