Grimmjoww231
05/14/2023, 6:52 PMcodeine
05/14/2023, 6:58 PMMondmarmelade
05/14/2023, 7:24 PMKiwiHour
05/14/2023, 8:00 PMsupabase.from("table_name").insert()
, you get intellisense like this.
Which are the required key-types to successfully insert a new row.
How can I get these key-types for my own addRow(row: KeyTypes)
function?
https://cdn.discordapp.com/attachments/1107396949038084118/1107396949709164574/image.png▾
landfight
05/14/2023, 8:19 PMhttps://cdn.discordapp.com/attachments/1107401905866547230/1107401906013360279/code.png▾
baba-ipa
05/14/2023, 8:53 PMKiwiHour
05/14/2023, 8:55 PMlake_mattiato
05/14/2023, 9:02 PMven
05/14/2023, 10:28 PMhttps://cdn.discordapp.com/attachments/1107434277165084732/1107434277332865094/enable_all_for_authenticated_users_is_returning_empty_array.png▾
McLean 25
05/14/2023, 10:47 PMts
const { data: fullList } = await supabaseClient
.from("lists")
.select("*, items:list_items(*)")
.eq("id", listRankSessionId)
.single();
ts
const fullList: {
created_at: string;
id: string;
page: string;
title: string | null;
updated_at: string;
items: {
created_at: string;
description: string | null;
id: string;
is_archived: boolean;
isDone: boolean;
list: string | null;
position: number;
title: string;
updated_at: string;
} | {
created_at: string;
description: string | null;
id: string;
is_archived: boolean;
isDone: boolean;
list: string | null;
position: number;
title: string;
updated_at: string;
}[] | null;
} | null
Lyingcap
05/15/2023, 12:40 AM<hmmhmmhm/>
05/15/2023, 12:56 AMhttps://cdn.discordapp.com/attachments/1107471635587551255/1107471636011171850/Fv5yxYyaEAAp1gj.png▾
Vince
05/15/2023, 1:08 AMGnarley_Farley
05/15/2023, 3:49 AMActual Left Shark
05/15/2023, 4:19 AMconst signUp = async () => {
const { data, error} = await supabase.auth.signUp({
email:email,
password:password,
options: {
data: {
first_name: 'John',
last_name: 'Doe',
username: "john123,
},
},
})
and then can access this using useUser
from auth-helpers-react.
or is it better to do something like this
const signUp = async () => {
const { data, error} = await supabase.auth.signUp({
email:email,
password:password,
})
await supabase.from("profile").update({profile_name:"John123"}).eq("id",data.user.id)
}
and then fetch the data from the "profile" table with another call? I also have the second option using triggers/functions within supabase to keep the private auth table connected with the public facing "profile" table.
I am planning to keep a mixture of things in there like profile_name, ratings, etc.. but also including things like stripe UID's and their shipping address. Is option 1 more secure because it is not a public facing table?
My assumption is that I would need to combine both - the more secure data (stripe, address, etc..) in the more private 'useUser' approach. But for public facing things (username, rating, posts, etc..) it would need to be in the second option in a public facing table to allow other users (not just the one authenticated) to access the information. Does this seem correct logic? is this secure?
Using CRA -- thanks!xa
05/15/2023, 5:39 AMAPI Docs/Stored Procedures
, but when I push the changes to the remote database using supabase db push
, the function is missing. I have three functions and only one shows.
https://cdn.discordapp.com/attachments/1107542769624428594/1107551809238749204/Screenshot_2023-05-15_at_2.14.29_PM.png▾
Kjell
05/15/2023, 8:04 AMJTJTJTJT
05/15/2023, 9:14 AM{"code":"PGRST107","details":null,"hint":null,"message":"None of these media types are available: application/vnd.pgrst.plan+text"}%
Is there anyway else to check execution plan of postgrest api query ?Nxia618
05/15/2023, 10:04 AMsql
ALTER SEQUENCE “public”.”procurement.orders_id_seq” RESTART WITH 7000;
The name above matches that from pg_sequences,
This is driving me mad and stopping me going onto paid tier for productioncrypticBuddha
05/15/2023, 10:15 AMhttps://cdn.discordapp.com/attachments/1107612226774388786/1107612226929557575/image.png▾
perl
05/15/2023, 10:30 AMexport const revalidate = 0
export async function middleware(req: NextRequest) {
console.log("middleware ran")
const res = NextResponse.next()
const supabase = createMiddlewareSupabaseClient<Database>({ req, res })
const {
data: { session },
} = await supabase.auth.getSession()
if (!session && req.nextUrl.pathname !== "/sign-up") {
const url = new URL(req.url)
url.pathname = "/sign-up"
return NextResponse.redirect(url)
}
return res
}
And my google sign in function
async function signInWIthGoogle() {
const { data, error } = await supabase.auth.signInWithOAuth({
provider: "google",
options: {
redirectTo:
"https://usuals-consumer-web-git-app-router-storialp.vercel.app",
},
})
}
The issue from what I can gather fro the network tab is that cookies are set (or at least can be read) only after middleware has already redirected to the sign-up page.
When I look at the network tab, google tries redirecting to the specified route only to get denied (300 status code) by middleware. However, user only sees to be requested after the redirect is complete, as if js is executing the redirect without having first requested the session. It imght be worth noting that as recommended by the docs, in my supabase provider I am refreshing the page onAuthStateChange.
Also worth noting that if I manually change the url back to the homepage, middleware does detect the session and doesn't redirect me.
Have any of you dealt with this before or have any ideas? Would appreciate any help!!phil
05/15/2023, 11:27 AMhttps://cdn.discordapp.com/attachments/1107630297572454461/1107634717982982215/Screenshot_2023-05-15_at_3.43.40_PM.png▾
CamBlackwood
05/15/2023, 11:50 AMbombillazo
05/15/2023, 1:02 PMimport_map.json
file in the functions directory inside the supabase dir. However, when we run the deployed function, we get the following message:
sh
module not found: file:///src/import_map.json
How can we ensure our import-map.json is visible to the edge function?
https://cdn.discordapp.com/attachments/1107654159307645000/1107654159685144617/image.png▾
Conflicted Cortana
05/15/2023, 1:09 PMhttps://cdn.discordapp.com/attachments/1107655887465758852/1107655889248329758/project.png▾
Xquick
05/15/2023, 1:09 PMEvent message
module not found: file:///src/import_map.json
Any idea please? I tried deploying with --importMap flag as well but no luck. Locally function works just fine.
Thank you for any help 🙏sb
05/15/2023, 2:01 PMven
05/15/2023, 2:23 PMformigueiro
05/15/2023, 2:33 PMjs
import { serve } from "https://deno.land/std@0.168.0/http/server.ts"
console.log("Hello from Functions!")
serve(async (req) => {
const { name, record } = await req.json()
const data = {
message: `Hello ${name}!`,
record
}
return new Response(
JSON.stringify(data),
{ headers: { "Content-Type": "application/json" } },
)
})
and im using this header, but im gertting 401 (Invalid JWT), but im copy equal
https://cdn.discordapp.com/attachments/1107677220660588615/1107677221033885706/image.png▾
Ho3einvb
05/15/2023, 2:42 PM