Incorrect RPC Types After Select
jdgamble555 opened this issue · comments
Jonathan Gamble commented
Bug report
- I confirm this is a bug with Supabase, not with my own application.
- I confirm I have searched the Docs, GitHub Discussions, and Discord.
Describe the bug
The Typing For RPC Functions is incorrect after a select
. I do not have access to eq
, contains
, or
, etc...
For example:
const { data, error } = await supabase.rpc('custom_function').select('*, author(*)')
.eq(... // can't do this
.or(... // can't do this
To Reproduce
- Create an rpc function that returns a
setof posts
(or any table). - Make sure to update your types
supabase gen types typescript --local > database.ts
(or whatever file) - Import the types in your createClient as usual per the generating types
This is the result:
Expected behavior
from
and rpc
should work the exact same way:
You can see I can scroll a lot further in this example.
System information
- OS: Windows 11
- Version of supabase-js: 2.36.0
- Version of supabase: 1.99.5
- Version of Node.js: 18
Additional context
It is very important to note that this DOES WORK. postgREST
DOES support these filters. supabase-js
does not.
J
Jonathan Gamble commented
This can actually be closed out. You can do the eq
and all the other filters before the select, which is probably more efficient anyways. Didn't think of that before.
J