feat: Ability to save/load queries from sqlite file#395
Open
shaunpatterson wants to merge 3 commits into
Open
Conversation
Add support for preloading common DQL queries from a YAML configuration file. Users can select queries from a "Templates" dropdown in the query editor, fill in variable placeholders via a modal dialog, and execute directly. Features: - YAML config file with queries, categories, and variable definitions - Templates dropdown grouped by category in EditorPanel - Variable substitution modal with validation for required fields - Support via --preloaded-queries flag or RATEL_PRELOADED_QUERIES env var - Example config file with common Dgraph query patterns Server changes: - New /api/preloaded-queries endpoint serving JSON from YAML config - Type definitions in server/preloaded.go - Added gopkg.in/yaml.v3 dependency Client changes: - Redux actions/reducer for preloaded queries state - PreloadedQueryDropdown and PreloadedQueryModal components - Integration into EditorPanel Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Replace read-only YAML-based preloaded queries with a full CRUD system using SQLite for persistent, user-editable saved queries. Changes: - Add SQLite database for saved queries (modernc.org/sqlite, pure Go) - Add REST API endpoints for CRUD operations - Add SavedQueriesDropdown with edit/delete functionality - Add SaveQueryModal for saving/editing queries - Add Save button to EditorPanel - Remove all YAML/preloaded query code API endpoints: - GET /api/saved-queries - List all queries - POST /api/saved-queries - Create new query - PUT /api/saved-queries/:id - Update query - DELETE /api/saved-queries/:id - Delete query Usage: - Set RATEL_QUERIES_DB=/path/to/queries.db or --queries-db flag - SQLite file can be committed to repo for team sharing Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add documentation for RATEL_QUERIES_DB env var and --queries-db flag - Create CHANGELOG.md documenting the saved queries feature - Fix: selecting a query now loads without auto-running - Fix: dropdown closes after selecting or editing a query - Add Go server tests for saved queries CRUD operations - Add Redux reducer and actions tests for saved queries - Add dev proxy for API calls during local development - Default DB path now uses OS temp directory (cross-platform) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
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.
Description
Gives the ability to save and load queries to a sqlite3 file.
Checklist
CHANGELOG.mdfile describing and linking tothis PR
staged and linked here