Invalid input syntax for type bigint

Hi, i've just started using supabase with nextjs. I have i simple function that retrieve user data from 'profiles'
let { data, error, status } = await supabase
.from("profiles")
.select(`username`)
.eq("id", id)
.single();

if (error && status !== 406) {
throw error;
}

if (data?.username) {
router.push({ pathname: "/[account]", query: { account: id } });
return;
}
let { data, error, status } = await supabase
.from("profiles")
.select(`username`)
.eq("id", id)
.single();

if (error && status !== 406) {
throw error;
}

if (data?.username) {
router.push({ pathname: "/[account]", query: { account: id } });
return;
}
At the [account].tsx page i'm receiving the id and making another query to 'profiles' to get user data, but this time i'm also getting the property avatar, which in my schema is defined as 'text'. But i'm receiving this error when i try to retrieve the avatar. The "4bc97434-c7a5-4a5e-a32d-e1c66a6a588e" is my user.id. After i uploaded the image to storage i retrieve it's url by getPublicUrl and updated the avatar property of the user. I don't understand what am i doing wrong here.
No description
4 Replies
garyaustin
garyaustin3y ago
You don't provide much info on your tables. But seems you have an id column that is bigint and you are passing a UUID string.
Talajax
TalajaxOP3y ago
These are my columns schema
No description
Brandon
Brandon3y ago
I had a similar problem, I think I solved it by deleting the "profiles" and re-creating it, selecting uuid as I created it. For some reason that worked. Even though the schema appeared to be 100% right in the dashboard.
Talajax
TalajaxOP3y ago
Thanks, i'll try it So i created another property called avatar_url and defined it as varchar And it's working apparently

Did you find this page helpful?