-
-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Name mapping on post/put/patch #1773
Comments
This is kind of related to #465 (comment), as well. |
For this I think we'd need to process the json in a previous step to The proposed query on #1567 (comment) could help with that. |
After working with PostgREST a little more I've come to the conclusion that this feature should not be implemented. I think the way to address the leaking of the Postgres column name format into application code is through the creation of REST specific schemas and the use of the AS clause in views within the isolated schemas as described in the schema isolation docs. The ability to GET and POST to the views means that JSON naming conventions can be maintained within the application code and column naming conventions can be maintained in Postgres. I'd even suggest that the use of column renaming in select query parameters to address name format issues is an anti pattern but could be wrong on that. |
I don't agree. I use renaming in two cases primarily:
Allowing this for |
Just exploring postgrest and very impressed with it.
I like the name mapping ability as part of the get select syntax (e.g. select=contactId:contact_id). It means that an implementation detail (postgres column naming) doesn't leak into my code (I define my get url in configuration).
For posts the same isn't true (the post payload needs to use the column names) as I don't believe there is equivalent functionality for the columns parameter (e.g. columns=contactId:contact_id).
An example of where this might be useful is if I wanted to use Postgrest in development but another document store in production through configuration only and without having to adopt Postgres column naming conventions..
Is this something which has been considered?
Thanks in advance.
The text was updated successfully, but these errors were encountered: