-
-
Notifications
You must be signed in to change notification settings - Fork 332
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 for editing records within a view #470
Comments
We need to work on a good definition of "updatable" for views. For example, an "updatable" view would necessarily:
|
@mathemancer does the definition of updatable in the tutorial I linked to in the main issue work? |
We could start there, but we'll need to add to the functionality eventually to get as many views as possible to be updatable. The PostgreSQL definition is pretty conservative. We should also probably check on nullable columns, and duplicate columns, since these aren't shown in the definition and they create problems that make the view impossible to write to (in the former case) and give the possibility of trying to make impossible writes for logical consistency reasons (in the latter case). BTW, here's the link to the page from the PostgreSQL docs that was cut-and-pasted by that infernal tutorial site: https://www.postgresql.org/docs/13/sql-createview.html Finally, PostgreSQL doesn't actually mark the view as updatable in any visible way, so we'll need to make some checks ourselves regardless if we want to be able to know whether the view is updatable before trying it. |
@mathemancer Thanks for the link, I've updated the link in the issue description. I did look for the information in the Postgres docs but apparently not very well. For the scope of this issue, let's use the PostgreSQL definition. I'll create a separate issue for making more views updatable. I'm not sure if it's worth doing for the MVP yet, since there will be significant complexity involved. |
Unfortunately, the PostgreSQL docs' SEO is not as strong as the tutorial site you linked. That site seems to wash the relevant docs page out of the first page of google results pretty regularly for me. |
This issue has not been updated in 90 days and is being marked as stale. |
I'm closing this issue. Backend work will be tracked in this issue once design work has been completed: |
Problem
Users may want to edit data in views.
Proposed solution
If a view is updatable, we want to support record creates, updates, and deletes via the
/api/v0/views/<id>/records/
API. This should function similarly to the table records API.If a view is not updatable, the records API should be read only. We should return whether a view is updatable in the top-level
/api/v0/views/
API.Additional context
The text was updated successfully, but these errors were encountered: