view_actions plugin hook, closes #2297

This commit is contained in:
Simon Willison 2024-03-12 14:25:07 -07:00
commit 909c85cd2b
7 changed files with 85 additions and 21 deletions

View file

@ -391,6 +391,18 @@ def table_actions(datasette, database, table, actor):
]
@hookimpl
def view_actions(datasette, database, view, actor):
if actor:
return [
{
"href": datasette.urls.instance(),
"label": f"Database: {database}",
},
{"href": datasette.urls.instance(), "label": f"View: {view}"},
]
@hookimpl
def query_actions(datasette, database, query_name, sql):
# Don't explain an explain