Skip to content

Commit

Permalink
/dbname/tablename/-/modify-table-schema is OK after all
Browse files Browse the repository at this point in the history
Refs #1053, #296
  • Loading branch information
simonw authored Nov 2, 2020
1 parent d6257e3 commit 13d1228
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions docs/writing_plugins.rst
Original file line number Diff line number Diff line change
Expand Up @@ -227,10 +227,11 @@ If your plugin includes functionality that relates to a specific database you co

- ``/dbname/-/upload-excel``

Reserving routes under ``/dbname/tablename/-/...`` is not a good idea because a table could conceivably include a row with a primary key value of ``-``. Instead, you could use a pattern like this:
Or for a specific table like this:

- ``/dbname/-/upload-excel/tablename``
- ``/dbname/tablename/-/modify-table-schema``

Note that a row could have a primary key of ``-`` and this URL scheme will still work, because Datasette row pages do not ever have a trailing slash followed by additional path components.

.. _writing_plugins_building_urls:

Expand Down

0 comments on commit 13d1228

Please sign in to comment.