database_actions() plugin hook, closes #1077

This commit is contained in:
Simon Willison 2020-11-02 10:27:25 -08:00
commit 7b19492070
10 changed files with 97 additions and 8 deletions

View file

@ -333,3 +333,14 @@ def table_actions(datasette, database, table, actor):
},
{"href": datasette.urls.instance(), "label": "Table: {}".format(table)},
]
@hookimpl
def database_actions(datasette, database, actor):
if actor:
return [
{
"href": datasette.urls.instance(),
"label": "Database: {}".format(database),
}
]