-
-
Notifications
You must be signed in to change notification settings - Fork 333
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
Modify records API to use column id instead of column name #896
Comments
I think the breaking change option is superior (though a bit of a pain). |
Agreed re: breaking change. |
I have a few concerns with this change
|
We can figure out how to reflect Views when it comes to it, I don't know if we'll end up following the same format or not.
The frontend saves the filter queries that a user was last looking at. We might also cache this in the backend at some point.
I'm not sure what you're getting at here, can you elaborate? The general principle here is the column only has a single identifier throughout the API, which is its |
We discussed that a table can have a default filter or sort. So in case we end up not using |
Views have their own |
Alternatively, we could extend the column model to simply note whether it's a column of a table or of a view, and have some optional fields for view-specific metadata. |
Yup, we can have it be the same Django
I think that's the same thing, not an alternative. We could have separate models for |
My only concern is that this would limit us from using dynamically computed columns that could be generated by various means like |
If we do expose dynamically computed columns, we won't be using the same models as table columns or view columns to do so since they represent different underlying DB concepts. We can figure out the appropriate architecture for those when we get to them. |
I moved this to [06] Working with Tables because it it blocking some other work in that milestone. |
I'd like to be able to use the records API when all I know and care about is the column id for my columns.
GET request params
The
order_by
,group_count_by
, andfilters
params all expect references to columns to be given by name. For example:order_by=[{"field":"name","direction":"asc"}]
group_count_by=["name"]
filters={"and":[{"field":"name","op":"eq","value":"Sean"}]}
I'd like to the API to accept column references by
id
.As a breaking change
A simple way to address this need would be to break the API, no longer accepting column references by name
order_by=[{"field":"1","direction":"asc"}]
group_count_by=["1"]
filters={"and":[{"field":"1","op":"eq","value":"Sean"}]}
As a backwards compatible change
Another approach would be to accept both references by name and by id. If I want to use the column id, I would do:
order_by=[{"field_id":"1","direction":"asc"}]
group_count_by_ids=["1"]
filters={"and":[{"field_id":"1","op":"eq","value":"Sean"}]}
GET Response
Currently the records API response look like:
To avoid relying on the column name, I'd like the response to give the column id as keys instead.
This would need to be a breaking change.
POST and PATCH request and response
Request and response bodies look like:
I'd like to be able to update a record or add a new record by sending something like:
Additional context
id
#839The text was updated successfully, but these errors were encountered: