Query history
Every SQL query you execute is automatically saved to your history (hooks/use-query-history.ts). Access it from the History button in the Query Tool toolbar.
What’s stored
Each history entry includes:- Query text: The complete SQL statement
- Timestamp: When the query was executed
- Server and database: Where it ran
- Execution time: Duration in milliseconds
- Row count: Number of rows affected or returned
- Status: Success or error
- Error details: If the query failed
Viewing history
The query history dialog (components/query-history-dialog.tsx) shows:
- Most recent queries first
- Color-coded status (green for success, red for errors)
- Expandable query text for long queries
- Hover to see full details
Using history
Click any query in your history to:- Load it into the current editor
- Modify as needed
- Re-execute
Query history is shared across all query tabs, making it easy to reuse queries anywhere.
History limits
By default, Poge stores:- Last 100 queries per server/database combination
- Older queries are automatically removed
- Total history size limited to 5MB
Clearing history
Clear your query history:- Open Settings → Data Management
- Click Clear Query History
- Confirm the action
Saved queries
Save frequently used queries for quick access (hooks/use-saved-queries.ts).
Saving a query
- Write or load your query in the editor
- Click Save Query (bookmark icon)
- Fill in:
- Name: Descriptive name for the query
- Description (optional): What the query does
- Tags (optional): Keywords for organization
- Click Save
Loading saved queries
Access saved queries from the Load Query dialog:- Click Load Query button
- Browse or search your saved queries
- Click a query to load it
- Server: Which PostgreSQL server
- Database: Which database
- Tags: Custom categories
Editing saved queries
Modify a saved query:- Load the query in the editor
- Make your changes
- Click Save Query again
- Use the same name to overwrite, or a new name to create a copy
Deleting saved queries
- Open the Load Query dialog
- Hover over the query card
- Click the Delete button (trash icon)
- Confirm deletion
Query templates
Poge includes built-in query templates for common operations (components/query-templates-dialog.tsx).
Available templates
Table inspection
Performance analysis
Index analysis
Using templates
- Click Templates in the toolbar
- Browse template categories
- Click a template to load it
- Customize placeholders (like
table_name) - Execute the query
Notes and scratch pad
The scratch pad (components/scratch-pad.tsx and components/notes.tsx) provides a space for:
- Quick notes and reminders
- Documentation of database structure
- Query planning and brainstorming
- Paste temporary data
Creating notes
- Click Notes in the sidebar
- Click New Note
- Give your note a title
- Write content using Markdown
- Notes auto-save as you type
Organizing notes
Notes support:- Folders: Organize notes by project or topic
- Tags: Add keywords for easy searching
- Favorites: Star important notes
- Search: Full-text search across all notes
Markdown support
Notes use Markdown formatting:Sharing notes
Export notes to share with your team:- Open the note
- Click Export → Markdown
- Share the .md file
Storage and backup
All history, saved queries, and notes are stored locally:- Location: Browser localStorage
- Encryption: Included in encrypted backups (.enc files)
- Size: Limited by browser (typically 5-10 MB)
- Persistence: Survives browser restarts
Creating backups
- Go to Settings → Backup & Restore
- Click Create Backup
- Choose:
- Full backup: Everything including connection details (encrypted)
- Data only: History, queries, notes (encrypted)
- Settings only: No sensitive data (plain JSON)
- Save the backup file
Create backups regularly, especially before major database operations or when sharing your computer.
Restoring from backup
- Go to Settings → Backup & Restore
- Click Restore from Backup
- Select your .enc backup file
- Enter the encryption password
- Choose what to restore:
- Connection servers
- Saved queries
- Query history
- Notes
- Settings
- Click Restore
Next steps
Query tool
Learn more about writing and executing queries
Backup and restore
Complete guide to backing up your data
Keyboard shortcuts
Speed up your workflow with shortcuts
Settings
Configure history limits and auto-save behavior