datasette/datasette/views
Claude 5b6cf45568
Add web UI to edit and delete stored queries
Stored query pages now offer Edit and Delete actions in the query
actions menu, gated by the update-query and delete-query permissions.

- New QueryEditView (GET/POST at /<db>/<query>/-/edit) renders a
  pre-filled form for editing a query's title, description, SQL and
  privacy, reusing the create-query analysis UI. Changing the SQL still
  requires execute-sql; metadata-only edits do not.
- QueryDeleteView gains a GET confirmation page and HTML form POST that
  redirects to the query list, while keeping the existing JSON API.
- New default query_actions hook adds the Edit/Delete links for stored
  (non-config, non-trusted) queries the actor is allowed to manage.

Permission semantics (already enforced by default_query_permissions_sql)
are surfaced in the UI: owners can always edit/delete their queries;
non-private queries can be edited/deleted by any actor with the relevant
permission; private queries remain owner-only.

Shared the create-query form styles into _query_form_styles.html so the
edit form can reuse them.

https://claude.ai/code/session_019GU9g3pZAERukLKYNa4uAL
2026-06-01 21:00:04 +00:00
..
__init__.py Drop 3.8 testing, add 3.13 testing, upgrade Black 2025-03-09 20:45:18 -07:00
base.py Fix double-prefixed export links with base_url 2026-05-30 22:41:54 -07:00
database.py Fixes for SQL write with RETURNING (#2763) 2026-05-31 16:15:34 -07:00
execute_write.py Fixes for SQL write with RETURNING (#2763) 2026-05-31 16:15:34 -07:00
index.py Black formatting 2026-02-17 13:30:24 -08:00
query_helpers.py Add web UI to edit and delete stored queries 2026-06-01 21:00:04 +00:00
row.py Refactor ColumnType: register classes, return instances with config 2026-03-17 05:18:14 +00:00
special.py Fix remaining base_url issues 2026-05-30 22:48:04 -07:00
stored_queries.py Add web UI to edit and delete stored queries 2026-06-01 21:00:04 +00:00
table.py Fix double-prefixed export links with base_url 2026-05-30 22:41:54 -07:00