mirror of
https://github.com/simonw/datasette.git
synced 2025-12-10 16:51:24 +01:00
database_actions() plugin hook, closes #1077
This commit is contained in:
parent
b61f6cceb5
commit
7b19492070
10 changed files with 97 additions and 8 deletions
|
|
@ -1057,3 +1057,19 @@ This example adds a new table action if the signed in user is ``"root"``:
|
|||
"href": datasette.urls.path("/-/edit-schema/{}/{}".format(database, table)),
|
||||
"label": "Edit schema for this table",
|
||||
}]
|
||||
|
||||
.. _plugin_hook_database_actions:
|
||||
|
||||
database_actions(datasette, actor, database)
|
||||
--------------------------------------------
|
||||
|
||||
``datasette`` - :ref:`internals_datasette`
|
||||
You can use this to access plugin configuration options via ``datasette.plugin_config(your_plugin_name)``, or to execute SQL queries.
|
||||
|
||||
``actor`` - dictionary or None
|
||||
The currently authenticated :ref:`actor <authentication_actor>`.
|
||||
|
||||
``database`` - string
|
||||
The name of the database.
|
||||
|
||||
This hook is similar to :ref:`plugin_hook_table_actions` but populates an actions menu on the database page.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue