Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

API to drop a table #1874

Closed
Tracked by #1850
simonw opened this issue Oct 30, 2022 · 4 comments
Closed
Tracked by #1850

API to drop a table #1874

simonw opened this issue Oct 30, 2022 · 4 comments

Comments

@simonw
Copy link
Owner

simonw commented Oct 30, 2022

POST /db/table/-/drop

Require drop-table permission.

@simonw simonw mentioned this issue Oct 30, 2022
17 tasks
simonw added a commit that referenced this issue Oct 30, 2022
@simonw
Copy link
Owner Author

simonw commented Oct 30, 2022

@simonw
Copy link
Owner Author

simonw commented Nov 14, 2022

Found a bug: you get a 500 error if you try this against an immutable database.

@simonw
Copy link
Owner Author

simonw commented Nov 14, 2022

I also changed the confirmation JSON returned by this endpoint to add the database and table like so:

{
    "ok": true,
    "database": "data",
    "table": "docs",
    "row_count": 1,
    "message": "Pass \"confirm\": true to confirm"
}

Updated docs: https://docs.datasette.io/en/1.0-dev/json_api.html#dropping-tables

@simonw
Copy link
Owner Author

simonw commented Nov 14, 2022

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant