mirror of
https://github.com/simonw/datasette.git
synced 2025-12-10 16:51:24 +01:00
/db/table/-/drop API, closes #1874
This commit is contained in:
parent
4f16e14d7a
commit
2865d3956f
6 changed files with 114 additions and 11 deletions
|
|
@ -40,7 +40,7 @@ from .views.special import (
|
|||
PermissionsDebugView,
|
||||
MessagesDebugView,
|
||||
)
|
||||
from .views.table import TableView, TableInsertView
|
||||
from .views.table import TableView, TableInsertView, TableDropView
|
||||
from .views.row import RowView
|
||||
from .renderer import json_renderer
|
||||
from .url_builder import Urls
|
||||
|
|
@ -1276,6 +1276,10 @@ class Datasette:
|
|||
TableInsertView.as_view(self),
|
||||
r"/(?P<database>[^\/\.]+)/(?P<table>[^\/\.]+)/-/insert$",
|
||||
)
|
||||
add_route(
|
||||
TableDropView.as_view(self),
|
||||
r"/(?P<database>[^\/\.]+)/(?P<table>[^\/\.]+)/-/drop$",
|
||||
)
|
||||
return [
|
||||
# Compile any strings to regular expressions
|
||||
((re.compile(pattern) if isinstance(pattern, str) else pattern), view)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue