-
-
Notifications
You must be signed in to change notification settings - Fork 379
Open
Labels
enhancementNew feature or requestNew feature or requestpostgrestIssues related to postgrest-pyIssues related to postgrest-pypythonPull requests that update Python codePull requests that update Python code
Description
The PostgREST API supports embedding related resources on write operations by using the select query parameter.
Currently, postgrest-py provides the .select() method for read operations, but there isn't a direct way to apply it to insert(), update(), or delete calls to achieve this embedding.
Would it be possible to extend the builder pattern to allow .select() to be chained after insert(), update() and delete() methods?
Currently, I can achieve this by manually manipulating the request parameters after building the initial insert/update request. This works but is not ideal as it relies on internal implementation details.
My current workaround (with postgrest-py v2.20.0):
values = { "title": "127 hours", "director_id": "40", ... }
req = client.from_("films").insert(values, returning=ReturnMethod.representation)
# Manually add the 'select' parameter before execution
req.params = req.params.add("select", "title,year,director:directors(first_name,last_name)")
response = await req.execute()Thank you for considering it
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or requestpostgrestIssues related to postgrest-pyIssues related to postgrest-pypythonPull requests that update Python codePull requests that update Python code