battlesheep123
04/25/2023, 6:27 PMven
04/25/2023, 6:34 PMsten
04/25/2023, 6:50 PMsten
04/25/2023, 7:30 PMnpx supabase db dump --db-url "https://xxxxxxxx.supabase.co" -f roles.sql --role-only
Error: cannot parse `https://xxxxxxxx.supabase.co`: failed to parse as DSN (invalid dsn)
What is wrong here? Following instructions here
https://supabase.com/docs/guides/platform/migrating-and-upgrading-projects
I assumed it to be the Project URL under settings in supabase.Vik
04/25/2023, 8:35 PMhttps://cdn.discordapp.com/attachments/1100520482857550006/1100520483230847018/Screenshot_2023-04-25_at_1.33.36_PM.png▾
anargiris
04/25/2023, 8:38 PMosamita
04/25/2023, 8:50 PMJolly Joy
04/25/2023, 9:14 PMlandfight
04/25/2023, 10:32 PMhttps://cdn.discordapp.com/attachments/1100549924908699768/1100549925722411008/code.png▾
formigueiro
04/25/2023, 10:36 PMjs
const handleLogin = async () => {
try {
const { user, error } = await supabase.auth.signInWithPassword({
email: email.value,
password: password.value
})
if (error) throw error
else {
await supabase.auth.refreshSession()
useNuxtApp().$toast.success('Login efetuado com sucesso!', {
theme: 'dark'
})
navigateTo('/dashboard') // redireciona para /admin após o login bem-sucedido
}
} catch (error) {
useNuxtApp().$toast.error('Falha ao logar. Tente novamente!', {
theme: 'dark'
})
}
}
im using https://supabase.nuxtjs.org/mansedan
04/25/2023, 11:40 PMjs
const { data, error } = await supabase.from('sports_odds').select('*,events_odds_api(*)')
the events_odd_api
is a table that has a column sport
which references a unique column from sports_odds
We are hoping to query the sports_odds
table and populate in the rows from events_odd_api
all in one query. Is this possible?andrewonaboat
04/26/2023, 1:03 AMFreddieDredd
04/26/2023, 1:11 AMhttps://cdn.discordapp.com/attachments/1100589937360900209/1100589937881002014/image.png▾
https://cdn.discordapp.com/attachments/1100589937360900209/1100589938082316310/image.png▾
landfight
04/26/2023, 2:40 AMhttps://cdn.discordapp.com/attachments/1100612262579937280/1100612263234240614/image.png▾
https://cdn.discordapp.com/attachments/1100612262579937280/1100612263506890773/code.png▾
Riley
04/26/2023, 3:08 AMhttps://cdn.discordapp.com/attachments/1100619424282722314/1100619424437907456/image.png▾
deathless
04/26/2023, 3:11 AMnimo
04/26/2023, 3:27 AMSUPABASE_SERVICE_ROLE_KEY
. I'm a little concerned about doing that though, and curious if there's an easy / good workaround to make sure that RLS policies are preserved in background jobs?
Thanks.sreetamdas
04/26/2023, 3:38 AMsupabase start
in order to serve my edge function locally for development, and it fails with the following error:
Error: ERROR: role "pg_read_all_data" does not exist (SQLSTATE 42704)
At statement 44: GRANT pg_read_all_data TO supabase_read_only_user GRANTED BY postgres
Not sure what is causing this, but my guess is that the pg_read_all_data
role was introduced in a newer version of Postgres, while my project is using v13.3.0.4
.Sarcodo
04/26/2023, 6:09 AMERROR: duplicate key value violates unique constraint "user_pkey"
. I have a trigger which I assume is where the problem lies, however I've tested it before and it has worked and it also works on our local db.
All trigger changes in our migrations are as follows:
CREATE FUNCTION "public"."handle_new_user"() RETURNS "trigger"
LANGUAGE "plpgsql" SECURITY DEFINER
AS $$
begin
insert into public.user (user_id)
values (new.id);
return new;
end;
$$;
ALTER FUNCTION "public"."handle_new_user"() OWNER TO "postgres";
GRANT ALL ON FUNCTION "public"."handle_new_user"() TO "anon";
GRANT ALL ON FUNCTION "public"."handle_new_user"() TO "authenticated";
GRANT ALL ON FUNCTION "public"."handle_new_user"() TO "service_role";
CREATE TRIGGER on_new_user AFTER INSERT ON auth.users FOR EACH ROW EXECUTE FUNCTION handle_new_user();
I can't seem to see why I would be getting the error, in the network tab in the browser the uuid it spits out to say it duplicated doesn't exist in the db so I'm unsure what to do. The auth logs on the signup failing also just show the duplicate key violation and not much more to go offcohlar
04/26/2023, 7:28 AMnot null
constraint on domains.
I have a dimensions
domain and a products
table with one product:
sql
create domain dimensions as real [] not null check (cardinality(value) = 3);
create table public.products (
id bigint primary key generated by default as identity,
sku text unique not null check ("sku" <> ''),
dimensions dimensions,
archived boolean default false not null
);
insert into public.products (sku, dimensions, archived)
values ('sku-1', array [1,2,3], false);
Then I would like to update a record of the products
table from my client as follows:
js
supabase.from('products').update({ archived: true }).eq('id', 1);
However I get the following error from posgtrest: "domain dimensions does not allow null values".
It doesn't seem to be a postgres restriction as when I update the record with SQL as follows, everything works fine:
sql
update public.products set archived = true where id = 1;
The below workaround works for me for now (move not null
from the domain definition to the table column).
sql
create domain dimensions as real [] check (cardinality(value) = 3);
create table public.products (
id bigint primary key generated by default as identity,
sku text unique not null check ("sku" <> ''),
dimensions dimensions not null,
archived boolean default false not null
);
insert into public.products (sku, dimensions, archived)
values ('sku-1', array [1,2,3], false);
Thanks for your help - I also created an issue on github: https://github.com/supabase/supabase/issues/13978in
04/26/2023, 7:36 AMand_g
04/26/2023, 7:53 AMhttps://cdn.discordapp.com/attachments/1100691072914563144/1100691073770205224/Screenshot_2023-04-26_at_09.50.19.png▾
https://cdn.discordapp.com/attachments/1100691072914563144/1100691074168668321/Screenshot_2023-04-26_at_09.48.56.png▾
https://cdn.discordapp.com/attachments/1100691072914563144/1100691074491625594/Screenshot_2023-04-26_at_09.47.33.png▾
https://cdn.discordapp.com/attachments/1100691072914563144/1100691075011715122/Screenshot_2023-04-26_at_09.45.16.png▾
alitnk
04/26/2023, 7:56 AMMartinW
04/26/2023, 8:04 AMFetch API cannot load http://localhost/auth/v1/signup due to access control checks.
Any suggestions on configuration I'm missing?majordisco
04/26/2023, 9:12 AMid
is incrementing as expected from the Pipedream tests) but the records are not appearing in Supabase itself. Any ideas on why this might be happening?pArsLey7
04/26/2023, 10:07 AMfekdaoui
04/26/2023, 10:14 AMCzarSalad
04/26/2023, 10:20 AMRyuya
04/26/2023, 12:02 PMsignInWithOAuth
for github authentication.
I want to separate this redirectTo
by user status.
Specifically, I want to change the destination depending on whether is_onboarding_completed
in the user table is true or false.
The return value (data) of signInWithOAuth
is as follows and has no information to identify the user.
{
"provider": "github",.
"url": "https://[id].supabase.co/auth/v1/authorize?provider=github"
}
How can I accomplish this?