codesalim
11/20/2021, 6:05 PMMihai
11/20/2021, 7:32 PMmagicbyt3
11/21/2021, 10:38 AMjs
hint "No operator matches the given name and argument types. You might need to add explicit type casts."
message "operator does not exist: bigint -|- unknown"
code "42883"
details null
Anyone has an idea how I could work that out so the user can see his own standing?
Edit: or is there any way to get "my own score" + 100 players ahead?Scott P
11/21/2021, 7:07 PMmikewilliams
11/22/2021, 7:54 PMkavla
11/23/2021, 3:55 PMkavla
11/23/2021, 3:57 PMInRed
11/24/2021, 12:12 AMonAuthStateChange
fire an event when a new access token is requested/received? https://github.com/supabase/supabase/tree/master/examples/nextjs-with-supabase-authPragy
11/24/2021, 6:22 PMts
import { useQuery, UseQueryResult } from 'react-query';
import PostgrestFilterBuilder from '@supabase/postgrest-js/src/lib/PostgrestFilterBuilder';
async function resolve<T>(query: PostgrestFilterBuilder<T>): Promise<T[]> {
const { data, error } = await query;
if (error) throw new Error(`${error.message}: ${error.details}`);
if (!data) throw new Error('Data 404');
return data;
}
export function useAPI<T>(
query: PostgrestFilterBuilder<T>,
): UseQueryResult<T, Error> {
const params = [...query.url.searchParams.values()].slice(1);
const queryKey = [query.url.pathname, ...params];
return useQuery(queryKey, () => resolve(query));
}
Using the above defined useAPI
hook allows me to simply pass the supabase query and get strictly typed results back.
Example usage
ts
const result = useAPI(
supabase.from<definitions['profiles']>('profiles').select(),
);
This however gives me a type error saying
ts
TS2345: Argument of type 'PostgrestFilterBuilder.default<{ id: string; username: string;}>' is not assignable to parameter of type 'PostgrestFilterBuilder.default<{ id: string; username: string;}>'.
Property 'method' is protected but type 'PostgrestBuilder<T>' is not a class derived from 'PostgrestBuilder<T>'.
bent
11/26/2021, 12:50 AMimages
containing three jpegs. I applied those default policies with public access to jpegs, public read access and also made the bucket public.
At some point supabase.storage.from("images").list()
worked. Now only supabase.storage.getBucket("images")
or .listBuckets()
etc. works
and I don't know what I changed.bent
11/26/2021, 12:51 AMbent
11/26/2021, 12:52 AMJSON
{
data: [],
error: null
}
bent
11/26/2021, 1:41 AMjonny
11/26/2021, 10:53 AMbent
11/26/2021, 12:29 PMbent
11/26/2021, 12:32 PMbent
11/26/2021, 12:33 PMuser
11/26/2021, 4:05 PMfrom('test').remove(['folder/test.png'])
and it is not removing the previous image from the storage bucket. I checked the network request and all it returns is an empty array. Any help would be appreciated.anothercoder
11/26/2021, 4:15 PMuser
11/26/2021, 4:40 PMbent
11/26/2021, 10:48 PMuser
11/26/2021, 11:17 PMbent
11/26/2021, 11:29 PMbent
11/26/2021, 11:48 PMbent
11/26/2021, 11:48 PMuser
11/27/2021, 12:40 AMbent
11/27/2021, 12:52 AMuser
11/27/2021, 12:57 AMNathan
11/27/2021, 2:58 AManothercoder
11/27/2021, 3:38 AM