Closed vogelino closed 1 year ago
Questions:
The call is a remote procedure call. The RPC should return the total count of rows.
-> We can use the count: exact
param of the SDK rpc function. See: https://supabase.com/docs/reference/javascript/next/rpc#with-count-option
Example request done with Deno:
import { createClient } from "https://esm.sh/@supabase/supabase-js@1.35.3";
const supabase = createClient(
"<SUPABASE URL>",
"<ANON TOKEN>",
);
const { data, error, count } = await supabase.rpc(
"ftc",
{ search: "mitte" },
{ count: "exact" },
);
if (error) {
console.error(error);
throw error;
}
console.log(count);
We make the request here