e0
08/15/2021, 4:36 PMe0
08/15/2021, 4:50 PM.rpc('hello_world', { count: 'exact' })
. I'm not sure how this would set the header since it would end up setting the params
object, which in turn sets the body
.e0
08/15/2021, 5:10 PMheaders
and body
shows that the correct header is not set and the body
is { count: 'exact' }
.e0
08/15/2021, 5:55 PMsupabase/postgrest-js
, the rpc('hello_world', { count: 'exact' })
would not work but .rpc('hello_world', undefined, { count: 'exact' })
should work. For stored procedures that take params, .rpc('hello', { name: 'world' }, { count: 'exact' })
should work as expected.
In supabase/supabase.js
, when using const supabase = createClient()
, the { count: 'exact' }
never works because it is never passed to `postgrest-js`: https://github.com/supabase/supabase-js/blob/ebb9bb293c9843302629687850020a2d411a05ed/src/SupabaseClient.ts#L98-L101
I will try to add these findings to the relevant repos now.e0
08/15/2021, 6:36 PMburggraf
08/15/2021, 9:58 PMconst { data: countdata, error: counterror, count } = await supabase.from('tablename)
.select('*', { head: true, count: 'exact' });
So maybe you need to add the head: true
part for .rpc()
?e0
08/15/2021, 10:02 PMhead
is supported at all for .rpc()
. I would need the data
anyways so I can't use head: true
.e0
08/15/2021, 10:04 PMhead
is implemented for `.select()`: https://github.com/supabase/postgrest-js/blob/master/src/lib/PostgrestQueryBuilder.ts#L25 and it's absent for `.rpc()`: https://github.com/supabase/postgrest-js/blob/master/src/lib/PostgrestRpcBuilder.ts#L23burggraf
08/15/2021, 11:59 PMdata.length
?e0
08/16/2021, 12:14 AMrange
for pagination. For example I want to return 50 rows but I want to know how many total matches there are. Anyways, like I mentioned in the message just before this thread, I already have a functional workaround. https://discord.com/channels/839993398554656828/869406062036529193/876472247919976509 Just wanted to see if others have noticed this too but after looking into it I’m almost certain that there are some bugs so I have reported them.e0
08/16/2021, 4:14 PM