React noob
07/21/2022, 5:00 PMsql
select * from storage.buckets.id = "hiking-picture"::text
``Failed to validate sql query: syntax error at or near "="``jar
07/21/2022, 6:14 PMdeclare
_person_id uuid;
begin
select id from public.persons where user_id = auth.uid()::text into _person_id;
select 1 from public.person_roles where person_id = _person_id and role_id = 'admin';
end;
This is my not correct but gives idea of aimgaryaustin
07/21/2022, 6:31 PMMax52
07/22/2022, 1:15 AMview product_info if purchases has row with product.id and user.id
. Hope that makes sense.Nin
07/22/2022, 8:40 AMUCDFiddes
07/22/2022, 1:38 PMcommands
and user_access
how can I make a policy so that when selecting from the commands
column, users will only be able to retrieve the rows that have the same server_id
value to what has been specified in the user_access
table linked with their user_id
.
The commands
table has the columns id
and server_id
The user_access
table has the columns id
, user_id
and server_id
garyaustin
07/22/2022, 1:41 PMRelisora
07/23/2022, 1:58 PMsql
SELECT season
FROM battle
INNER JOIN team ON battle.id = team.battle_id
WHERE wizard_id = 3
GROUP BY season
Any ideas? I would like to avoid creating a view or rpc if possiblegaryaustin
07/23/2022, 2:26 PMRelisora
07/23/2022, 3:38 PMgaryaustin
07/23/2022, 3:44 PMRelisora
07/23/2022, 3:45 PMRelisora
07/23/2022, 3:46 PMRelisora
07/23/2022, 3:46 PMnobody
07/23/2022, 9:46 PMgaryaustin
07/23/2022, 11:28 PMnobody
07/23/2022, 11:29 PMnobody
07/23/2022, 11:58 PMgaryaustin
07/24/2022, 12:08 AMnobody
07/24/2022, 12:22 AMbencehusi
07/24/2022, 4:10 PMKnex: Timeout acquiring a connection. The pool is probably full. Are you missing a .transacting(trx) call?
bencehusi
07/24/2022, 4:11 PMbencehusi
07/24/2022, 4:11 PMsilentworks
07/24/2022, 8:22 PMstefikira
07/24/2022, 11:18 PMpublic.users
when a user is deleted manually in auth.users
? I created a trigger on auth.users after a user is deleted and called this function, but it's not working
begin
delete from public.users where id = auth.uid();
return auth.uid();
end;
Also on the same note, is it me or this process of syncing auth.users with public.users is pretty cumbersome?
You have to create a public.users table to if you want to check if an email is already registered, because you cannot query auth.users directly, so you have to create a trigger for that. For every sync between these table a trigger is required. Am I missing something? It seems that instead of helping with the streamlining the users auth handling, you have to start spending a lot of time looking for these kind of solutions for these type of issues.garyaustin
07/24/2022, 11:49 PMstefikira
07/25/2022, 8:00 AMUCDFiddes
07/25/2022, 12:28 PMselect user_access.id, profiles.avatar from user_access inner join profiles on user_access.user_id = profiles.id
garyaustin
07/26/2022, 6:31 PMUCDFiddes
07/26/2022, 8:19 PM