-
-
Notifications
You must be signed in to change notification settings - Fork 700
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
Alter table support for the JSON write API #2101
Comments
datasette/datasette/views/table.py Lines 486 to 506 in 0f7192b
|
I just found my own need for this. I was trying to import a big bunch of JSON to create a table - https://schedules.ire.org/nicar-2024/nicar-2024-schedule.json - and I got an error because one of the later entries had new columns in it. Thoughts:
I think I'll need to add a new |
I'm really torn on whether or not you should need to pass That feels a bit confusing to me. The whole point of that API is "create a table that fits these example rows", so the fact that you had to alter later isn't really something the user should have to think about. I'm going to set alter True on the cases where a table is created from example rows. But... https://docs.datasette.io/en/latest/json_api.html#creating-a-table-from-example-data
|
Ideal would be for POST to |
It would be good to provide an explicit API for alter table as well, if we're adding a permission and an event type for it. Maybe this:
Question is, what should the JSON look like? And that varies depending on what alter operations are supported. If we're just adding columns it's pretty simple. But what about more advanced operations? Should this provide access to the full set of operations supported by |
I'm going to handle that |
In working on this I spotted a bug with the way events work for Instead it should do this:
|
Documentation:
|
Requested here: https://discord.com/channels/823971286308356157/823971286941302908/1129034187073134642
Original issue title:
alter: true
support for JSON write APIThe text was updated successfully, but these errors were encountered: