stibbs
09/29/2021, 11:48 PMRossveth
09/30/2021, 2:19 PMliljamesjohn
09/30/2021, 7:19 PMjstansbe
10/02/2021, 2:37 PMmagicbyt3
10/03/2021, 10:53 AMliljamesjohn
10/04/2021, 12:28 AMMiguel2390d
10/04/2021, 12:44 AMMiguel2390d
10/04/2021, 12:44 AMMiguel2390d
10/04/2021, 12:45 AMMiguel2390d
10/04/2021, 12:45 AMMiguel2390d
10/04/2021, 12:45 AMKhan W
10/04/2021, 12:46 AMThanks for registering, now check your email to complete the process.
And I'm not getting any email for the accounts I'm testing with :/Miguel2390d
10/04/2021, 12:49 AMKhan W
10/04/2021, 12:49 AMKhan W
10/04/2021, 12:49 AMKhan W
10/04/2021, 12:49 AMMiguel2390d
10/04/2021, 12:53 AMjavorszky
10/04/2021, 1:41 AMauth.users
table, as does everyone, and created a public.user_relationships
table to hold some relationships.
This query works when I use the query window
sql
select u.email, ur.employee_id from public.user_relationships ur left join auth.users u on u.id = ur.employee_id where ur.manager_id = '5995b4db-e19f-4f7c-9e55-10151b8a678a';
But how do I express that in javascript? Looking at this: https://supabase.io/docs/reference/javascript/select#query-the-same-foreign-table-multiple-times
js
const { data, error } = await supabase
.from('products')
.select(`
id,
supplier:supplier_id ( name ),
purchaser:purchaser_id ( name )
`)
I've tried doing
js
const {data, error} = await supabase
.from('user_relationships')
.select(`
employee_id:auth.users(id),
employee_id:auth.users(email)
`)
.eq('manager_id', auth.globalSession.user.id)
And getting this error: Could not find a relationship between user_relationships and users in the schema cache
, which I think is the closest I've got
The table structure is
sql
create table user_relationships (
manager_id uuid references auth.users on delete cascade not null,
employee_id uuid references auth.users on delete cascade not null
);
javorszky
10/04/2021, 1:55 AMjason-lynx
10/04/2021, 3:51 AMauth.users
jason-lynx
10/04/2021, 3:52 AMusers
table in the public schema to join with the user_relationships
tablejavorszky
10/04/2021, 7:11 AMHal
10/04/2021, 9:18 AMMihai Andrei
10/04/2021, 9:23 AMHal
10/04/2021, 10:10 AMMihai Andrei
10/04/2021, 10:13 AMHal
10/04/2021, 10:17 AMnoxy
10/05/2021, 7:54 PMnoxy
10/05/2021, 7:54 PMnoxy
10/05/2021, 7:55 PM