JuanFcoRomero
02/23/2023, 10:47 AMjimzer
02/23/2023, 11:19 AMAmara
02/23/2023, 11:45 AMjg247
02/23/2023, 12:05 PMtom
02/23/2023, 12:19 PMkeep-alive
rest api call too from the UI but this doesn't seem to work either. Any advice please?andrew.belong
02/23/2023, 1:15 PMconst { data, error } = await supabase.auth().signInWithOAuth({
provider: "facebook",
options: {
redirectTo: `${window?.location?.origin}/profile`,
queryParams: {
fields: "picture.type(large)",
},
},
});
Thanks in advance for any help.
PS. Maybe there is a chance to make a handle_new_user function in supabase to retrieve a big picture?Razoth
02/23/2023, 2:17 PMgeorgeg3g3g3
02/23/2023, 2:25 PMuseless
02/23/2023, 2:58 PMfloitsch
02/23/2023, 3:15 PMnmau
02/23/2023, 3:18 PMAadarsh805
02/23/2023, 3:41 PMuseEffect(() => {
const mySubscription = supabase
.from("interested_products")
.on("INSERT", (payload: any) => {
console.log("change in table", payload);
})
.subscribe();
return () => {
supabase.removeSubscription(mySubscription);
};
}, []);
Property 'on' does not exist on type 'PostgrestQueryBuilder
Property 'removeSubscription' does not exist on type 'SupabaseClient'drewbie
02/23/2023, 4:05 PM[FunctionsHttpError: Edge Function returned a non-2xx status code]
Should I be returning it in the response and parsing that in the client?
I also want to make sure that errors are clear for devs in the Function logs so that any problems are can be easily seen, so thats why I was leaning towards explicitly throwing an error so that the edge function fails. Will returning a 500 with the error in the response be good for the logs as well?
Any input on error handling Edge Functions would be appreciated. Thanksslavendjervida
02/23/2023, 4:31 PMsql
DELETE FROM users
Not sure is this the best ideaICAZ117
02/23/2023, 5:19 PMneidelson
02/23/2023, 5:50 PMVimes
02/23/2023, 6:19 PMshawntoubeau
02/23/2023, 6:20 PMgtims123
02/23/2023, 7:03 PM(${alreadyFetchedRows.map(row => row.name).join(',')})
,
);
}
This works somewhat, but unfortunately if postgres is unable to fetch 10 items I get 0 items back. This means that if there's still 4 items that I need to fetch for example, I can't get those items. It's related to the following PostgREST error: https://github.com/PostgREST/postgrest/issues/2470
I'm wondering if anybody has a workaround or can give me some insight on how to resolve this problem. Thanks šTSIA_SN
02/23/2023, 7:40 PMInvalid input for JSON type
.
It was working fine previously, and I'm not sure when the issue began happening. It looks like the last time there was a successful insert on the table was back in October, so I don't know if pg_graphql updated and broke it or what. This is how we're setting the field within the mutation:
js
set: {
Body: {
rating: 4
}
}
Where Body
is the name of the column and { rating: 4 }
is what we want to store in it. Could someone point out what's wrong with the approach? Do I need to JSON.stringify
the object first?Quentin
02/23/2023, 7:51 PMRomi
02/23/2023, 7:55 PMgtims123
02/23/2023, 8:02 PMUnknown Member
02/23/2023, 8:35 PMSeeSharp
02/24/2023, 12:00 AMxdotcommer
02/24/2023, 12:04 AMGreekShai
02/24/2023, 2:10 AMKellen Mace
02/24/2023, 2:11 AMts
type RuleResponse = Awaited<ReturnType<typeof getRule>>;
type RuleSuccess = NonNullable<RuleResponse["data"]> & {
rule_channels: {
channel_id: Pick<
Database["public"]["Tables"]["channels"]["Row"],
"id" | "thumbnail_url" | "title"
>;
}[];
} & {
rule_keywords: {
keyword_id: Database["public"]["Tables"]["keywords"]["Row"];
type: Pick<Database["public"]["Tables"]["rule_keywords"]["Row"], "type">;
}[];
};
async function getRule() {
return await supabaseClient
.from("rules")
.select(
`
id,
rule_channels (
channel_id( id, title, thumbnail_url )
),
rule_keywords (
keyword_id( id, keyword ),
type
)
`
)
.eq("id", $page.params.id)
.single();
}
I have to do a ton of manual work to compose the RuleSuccess
type. Not only that, but this code is really fragile. If a developer modifies the fields within one of the nested queries and forgets to manually update the RuleSuccess
type, that type would then be wrong. The TS compiler may not complain since it's just going by the hardcoded types it was given originally, and your dev team may be inadvertently shipping bugs to production.
I've found some threads in this Discord talking about pulling in additional libraries like Prisma to avoid dealing with the lack of TS support. š¬
I guess another option would be to manually add a bunch of types inside of the `Row: {}`s of the generated types file. But then you're stuck manually maintaining the generated types file and you risk it getting out-of-sync with the database.
Is there really no better way to handle this?ejkreboot
02/24/2023, 2:52 AM@supabase/supabase-js
library. I have no problem retrieving items from supabase storage, but when I try to query from my database tables I get:
{
"data": null,
"error": {
"code": "42501",
"details": null,
"hint": null,
"message": "permission denied for schema public"
}
}
The code to query the table I am using is:
import { createClient } from '@supabase/supabase-js'
import { SECRET_SUPABASE_PUBLIC_KEY, SECRET_SUPABASE_URL } from '$env/static/private'
export async function GET({ params, url }) {
const supabase = createClient(SECRET_SUPABASE_URL, SECRET_SUPABASE_PUBLIC_KEY);
const { data, error } = await supabase
.from('test')
.select()
return new Response(JSON.stringify({data, error}));
}
I have created RLS policies allowing SELECT access for the service_role
and public
roles to no avail.
After reading some similar questions here, I have tried a freshly created table, and I have restarted the server but the problem persists.
Any pointers would be much appreciated!BigSamHam
02/24/2023, 2:59 AM