How to filter one-to-one relationships by value in the joined table? #3216
Answered
by
laurenceisla
christopheraranda
asked this question in
Q&A
-
How do you filter the results of a query of one table based on the value in a joined table that has a one-to-one relationship? For example, given the database in the documentation: GET /films?select=title,technical_specs(camera) HTTP/1.1 how would I select only films that used the |
Beta Was this translation helpful? Give feedback.
Answered by
laurenceisla
Feb 8, 2024
Replies: 1 comment 7 replies
-
The filter works the same way as other relationships (see Embedded Filters in the docs). In this case, the query would be ( GET /films?select=title,technical_specs(camera)&technical_specs.camera=eq.Arriflex%2035-III HTTP/1.1 |
Beta Was this translation helpful? Give feedback.
7 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Ah, yeah, that changes everything. The Swagger output does not allow for custom query parameters right now, so the
technical-specs.camera
parameter cannot be added to the/films
endpoint. It's a limitation for now.I'll open an issue to keep track of it. This will be addressed in the
postgrest-openapi
project.Edit: Opened #3217