addisonschultz
05/31/2022, 9:00 AMtype
I have set for the column, but I'm not sure.
Basically, in a table I have numeric
column set. An example number in this column would be 3458764526524427914
When I retrieve the number (via JS client), I send something like this:
const { data, error } = await supabase
.from("table-name")
.select()
The returned value for the expected column is returned as 3458764526524428000
You can tell that it's the same number from the first half, but the last 4 digits are rounded up (to 8000
). In fact, this is the case with all of the numbers in my table (returned as rounded numbers) I have also tried this with int8
as a column type, and it is giving me the same issue.
Also interestingly enough, when the column is a numeric
type, the data/numbers (in the supabase table UI) look correct (but are returned wrong), and when the column is a int8
type, the data/numbers look incorrect (rounded) in the supabase ui (and are returned incorrectly (rounded)
What am I doing wrong??Yllik
05/31/2022, 9:40 AMAdi
05/31/2022, 3:18 PMNeedle
05/31/2022, 3:44 PMpocin
05/31/2022, 3:51 PMAn invalid response was received from the upstream server
Bicijay
05/31/2022, 4:34 PMabraxas
05/31/2022, 5:06 PMtaj
05/31/2022, 7:11 PMdbristow
05/31/2022, 7:32 PMApe R Us
05/31/2022, 7:46 PMimport supabase from '$lib/db';
import { user } from '$lib/stores/auth';
export const get = async () => {
try {
const id = user?.id;
const { data: events, error } = await supabase.from('event').select('*').eq('user_id', id);
console.log(user);
if (error) throw error;
return {
body: {
events
}
};
} catch (e) {
console.log({ e });
}
};
Im storing the user in a svelte store
export const user = writable(null, (set) => {
set(supabase.auth.user());
const subscribe = supabase.auth.onAuthStateChange((_, session) => {
session ? set(session.user) : set(null);
});
return () => {
subscribe.data.unsubscribe();
};
});
anyone have any ideas how to fix this?kresimirgalic
05/31/2022, 8:52 PMSagieq
05/31/2022, 9:48 PMoxlory
05/31/2022, 10:40 PMian_
05/31/2022, 10:44 PM(d,f,g)=> 🥁
05/31/2022, 11:54 PM.order()
an a .rpc()
request? the types seem to allow it, but then when the request goes through in the browser I get an error: js
{ message: "column pgrst_source.created_at does not exist", code: "42703", details: null, hint: null }
lumen
06/01/2022, 1:13 AMprofile
table in Prisma, where I want to store all my custom data:
model profile {
id String @id @default(cuid())
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
email String @unique
stripeCustomerId String? @unique
}
Now I want to create a trigger function that runs every time the user signs up with Supabase auth. It looks like this:
begin
insert into public.profile(id, email)
values(new.id, new.email);
return new;
end;
And I set up a trigger to run it every time a user is INSERTed into auth.users
.
Now when I try to sign up with Supabase Auth, I get an error "Database error saving new user", and when I look at Postgres logs, it says "permission denied for table profile".
It worked perfectly fine when I created tables manually via Supabase UI, it stopped working when I tried to create tables with Prisma. What have I done wrong? How can I fix this?lumen
06/01/2022, 2:20 AMProfile
table that holds custom data for my users. Every time a user signs up with Supabase Auth and is INSERTed into auth.users
table, I want to run a trigger function that adds the user to my Profile
table.
Everything works well when my table is called profile
and the function looks like this:
begin
insert into public.profile(id, email)
values(new.id, new.email);
return new;
end;
But now I want to capitalize the profile table name. I rename the profile
table into Profile
, and change the function to this:
begin
insert into public.Profile(id, email)
values(new.id, new.email);
return new;
end;
And it stops working, I'm getting an error:
> relation "public.profile" does not exist
Do you know what am I doing wrong? It's like postgres doesn't see that I have capitalized the table name when I'm referring to it in my postgres function.selique
06/01/2022, 4:31 AMnahtnam
06/01/2022, 7:39 AMuseAuth
, I get this error: Error: The request to /api/auth/user failed
and the error is error: "No cookie found!"
in the network inspector. Any ideas why?Sagieq
06/01/2022, 11:11 AMPeanut
06/01/2022, 12:48 PMJan Tennert
06/01/2022, 1:49 PMreed
06/01/2022, 7:03 PMuseUser()
hook from supabase-auth-helpers
tinus
06/01/2022, 7:35 PMnuxt/supabase
. From my localhost (http) everything is working as expected. Anyone know if I might have a problem with my setup. An example link can be found here:
https://www.bouwplaats.nu/login
https://www.bouwplaats.nu/register
If anyone has a suggetion what's wrong in my setup it would be really appreciated.theuknowner
06/01/2022, 8:04 PMGnee
06/01/2022, 9:55 PM// capturedPhoto.uri is file URI
const reponse = await fetch(capturedPhoto.uri);
const blob = await reponse.blob();
const { error: uploadError } = await supabase.storage
.from("fr8s")
.upload(`/content_uploads/${fileName}`, blob);
This doesn't work. I've also tried array buffer, also doesn't work.Guy Butts (datalytyks)
06/02/2022, 12:00 AMNeedle
06/02/2022, 1:13 AMsbr
06/02/2022, 4:11 AMatob is not defined for NextJS
. The only references of atob
in my code are in supabase-auth-helpers. @thorwebdev how can I fix this?joshcowan25
06/02/2022, 4:24 AM