Commit Graph

9 Commits

Author SHA1 Message Date
Peter Stockings
bd8a3fcdb2 refactor: Use REST API for Gemini SQL generation
- Modified the `_generate_sql_from_natural_language` helper function in `routes/sql_explorer.py` to use direct REST API calls via the `requests` library instead of the `google-generativeai` Python library.
- Added `requests` and `json` imports and removed the `google-generativeai` import.
- Updated error handling for API communication and response parsing.
- Updated the corresponding changelog entry.
2025-04-05 21:17:56 +11:00
Peter Stockings
a8fe28339b I have refactored the SQL Explorer functionality into its own blueprint (routes/sql_explorer.py) with a /sql URL prefix. This involved moving the relevant routes from app.py, registering the new blueprint, removing the old routes, updating url_for calls in the templates, and documenting the change in the changelog.
Here is a conventional commit message summarizing the changes:

```
feat: Refactor SQL Explorer into blueprint

- Moved SQL Explorer routes (view explorer, save/load/execute/delete queries, view schema, plot queries) from `app.py` into a new blueprint at `routes/sql_explorer.py`.
- Added `/sql` URL prefix to the blueprint.
- Registered the new `sql_explorer_bp` blueprint in `app.py`.
- Removed the original SQL Explorer route definitions from `app.py`.
- Updated `url_for` calls in relevant templates (`sql_explorer.html`, `partials/sql_explorer/sql_query.html`, `base.html`) to reference the new blueprint endpoints (e.g., `sql_explorer.sql_explorer`).
- Updated `templates/changelog/changelog.html` to document this refactoring.
```
2025-03-31 23:00:54 +11:00
Peter Stockings
5fe003bcbf Add loading icons to sql plot and add clear button to results container 2025-02-01 21:06:01 +11:00
Peter Stockings
8b02307397 Add plot functionality to unsaved sql query and use htmx 2025-02-01 20:26:54 +11:00
Peter Stockings
2d6c738e3e Max SQL query text box resize to query length 2024-11-09 23:18:57 +11:00
Peter Stockings
c7013e0eac Add ability to plot saved queries using plotly, need to check performance in production, also need to improve generate_plot function 2024-11-09 16:49:08 +11:00
Peter Stockings
23def088bb Add ability to save and edit queries, still need to add ability to edit queries 2024-11-08 23:09:19 +11:00
Peter Stockings
90cb1c1451 Add styling to sql query text area 2024-11-08 21:57:48 +11:00
Peter Stockings
0f55d42f22 * Add SQL query executor
* Move mermaid.min.js to static asset
* Create templates for sql logic
2024-11-06 23:25:25 +11:00