datasette/datasette
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
..
default_permissions Disallow update/delete of private queries 2026-05-26 14:10:48 -07:00
publish Get publish cloudrun working with latest Cloud Run (#2581) 2025-11-05 09:28:41 -08:00
static Renamed canned queries to queries / stored queries in docs 2026-05-26 15:17:51 -07:00
templates Add web UI to edit and delete stored queries 2026-06-01 21:00:04 +00:00
utils Fixes for SQL write with RETURNING (#2763) 2026-05-31 16:15:34 -07:00
views Add web UI to edit and delete stored queries 2026-06-01 21:00:04 +00:00
__init__.py register_token_handler() plugin hook for custom API token backends (#2650) 2026-02-25 16:32:45 -08:00
__main__.py Add support for running datasette as a module (#556) 2019-07-11 09:07:44 -07:00
_pytest_plugin.py Auto-close Datasette instances from function-scoped fixtures too 2026-04-16 20:32:19 -07:00
actor_auth_cookie.py Remove python-baseconv dependency, refs #1733, closes #1734 2022-05-02 12:39:06 -07:00
app.py Add web UI to edit and delete stored queries 2026-06-01 21:00:04 +00:00
blob_renderer.py Rename route match groups for consistency, refs #1667, #1660 2022-03-19 09:52:08 -07:00
cli.py datasette inspect now counts 10,000+ tables correctly (#2752) 2026-05-28 15:52:51 -07:00
column_types.py Optionally limit ColumnType subclasses to specific SQLite types (#2673) 2026-03-18 11:37:09 -07:00
csrf.py Normalize headers in CSRF checks, refs #2689 2026-04-14 19:24:38 -07:00
database.py Fixes for SQL write with RETURNING (#2763) 2026-05-31 16:15:34 -07:00
default_actions.py Rename canned queries to queries/stored queries in docs 2026-05-26 14:54:35 -07:00
default_column_types.py Optionally limit ColumnType subclasses to specific SQLite types (#2673) 2026-03-18 11:37:09 -07:00
default_database_actions.py No execute-write on immutable databases 2026-05-25 12:46:21 -07:00
default_debug_menu.py Remove source and source_key columns from JumpSQL 2026-05-23 20:41:32 -07:00
default_jump_items.py Remove source and source_key columns from JumpSQL 2026-05-23 20:41:32 -07:00
default_magic_parameters.py Fix datetime.utcnow deprecation warning 2024-03-15 15:32:12 -07:00
default_query_actions.py Add web UI to edit and delete stored queries 2026-06-01 21:00:04 +00:00
events.py RenameTableEvent, plus write connection track_event() mechanism (#2682) 2026-03-30 11:20:46 -07:00
facets.py Renamed canned queries to queries / stored queries in docs 2026-05-26 15:17:51 -07:00
filters.py Fix type annotation bugs and remove unused imports 2025-10-26 16:03:13 -07:00
fixtures.py datasette.fixtures module, closes #2733 2026-05-21 23:05:37 -07:00
forbidden.py Fixed a bunch of unused imports spotted with ruff 2024-02-06 17:27:20 -08:00
handle_exception.py Remove navigation_search_js_hash mechanism 2026-05-23 09:09:07 -07:00
hookspecs.py top_canned_query is now top_stored_query, closes #2747 2026-05-26 15:05:41 -07:00
inspect.py Black formatting 2026-02-17 13:30:24 -08:00
jump.py JumpSQL(database=) parameter 2026-05-23 21:00:04 -07:00
permissions.py Expanded analysis of SQL operations, refs #2748 2026-05-26 22:11:35 -07:00
plugins.py Add web UI to edit and delete stored queries 2026-06-01 21:00:04 +00:00
renderer.py Fix type annotation bugs and remove unused imports 2025-10-26 16:03:13 -07:00
resources.py Rename canned queries to queries/stored queries in docs 2026-05-26 14:54:35 -07:00
sql_functions.py _search= queries now correctly escaped, fixes #651 2019-12-29 18:48:30 +00:00
stored_queries.py datasette.yml can no longer set a query to private 2026-05-28 15:37:48 -07:00
tokens.py TokenRestrictions.abbreviated(datasette) utility method for creating _r dicts (#2696) 2026-04-17 08:44:43 -07:00
tracer.py Tracer now catches errors, closes #2405 2024-08-21 12:19:18 -07:00
url_builder.py count all rows button on table page, refs #2408 2024-08-21 19:09:25 -07:00
version.py Release 1.0a32 2026-05-31 16:21:24 -07:00
write_sql.py Allow SQL functions in SQL write queries 2026-05-28 10:22:28 -07:00