PostgrestTransformBuilder lacks filter methods #28234
Unanswered
antonio-bluco
asked this question in
Questions
Replies: 1 comment
-
Maybe worth raising as a bug? Did you find any workaround? |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I have a typescript function which returns data from either a view or a postgres function.
The postgres function returns set of the view:
So selecting from myFunction or from messageView is the same thing, only there's a different set of rows returned when using the function.
In my typescript function I do something like:
Then I continue after adding filter to dbQuery. This seems to work (the values returned are correct) but the type system complains that the two dbQueries are not compatible, so when I am assigning one to the other inside the if statement, things don't work out. Specifically, it seems that the value returned from
.rpc
, (which isPostgrestTransformBuilder
) doesn't have any filter method availables (e.g. no.eq
,.in
, etc) and therefore not compatible with thePostgrestFilterBuilder
.However this seems to be working - when I run the code, the filter methods are found and the results are as expected even if I take the branch that leads to the
rpc
usage.Can someone explain why this is happening, and how to fix the type system complaints?
Beta Was this translation helpful? Give feedback.
All reactions