abelsoares
10/04/2021, 3:36 PMsupabase-js
support queries with a different schema than public
? I have created tables with a diferent schema but i see no way to specify it in the queriesDeadlyDev
10/04/2021, 3:58 PMcreated_at | timestamp with time zone | timestamptz
id | uuid | uuid
receiver_id | uuid | uuid
sender_id | uuid | uuid
status | integer | int4
updated_at | timestamp with time zone | timestamptz
Both receiver_id and sender_id are foreign keys to user.id and both primary keys. I am trying to query this relationship table by user id, get back the relationship and the user for both receiver and sender for each relationship. I have tried a ton of combinations but this is currently what I have which seems to get me the closest so far.
const { data, error } = await supabase
.from('users')
.select(
`
id,
sender:relationships.sender_id ( * ),
receiver:relationships.receiver_id ( * )
`,
)
.eq('id', `${user.id}`);
Any advice or help would be greatly appreciated.
Edit (Self answer) - for those who need this type of query in the future, I was going about it backwards. While it breaks from other relationship querys you do actually want to query from relationships then use the foreign keys to get the users data.
const { data, error } = await supabase
.from('relationships')
.select(
'*, sender:users.sender_id (*), receiver:users.receiver_id (*)',
);
Steve
10/04/2021, 6:32 PMconst { data, error } = await supabase
.from('relationships')
.select(
'*, sender:users!sender_id (*), receiver:users!receiver_id (*)',
);
Using a dot .
on the embedded resource is deprecated, use !
instead.SaltyPotato
10/05/2021, 6:09 AMjs
let { data, error, status } = await supabase
.from('venues')
.select(`name`)
.eq('userid', user!.id)
.single();
Apologies if this is blatantly obvious but I couldn’t seem to find the answer anywhere on the internet so I thought you all might be able to helpjason-lynx
10/05/2021, 6:35 AMjason-lynx
10/05/2021, 6:37 AMSaltyPotato
10/05/2021, 6:45 AMSaltyPotato
10/05/2021, 6:45 AMjason-lynx
10/05/2021, 6:54 AMAnishDe12020
10/05/2021, 7:28 AMjason-lynx
10/05/2021, 8:02 AMjason-lynx
10/05/2021, 8:03 AMjason-lynx
10/05/2021, 8:04 AMauth.users
, supabase creates a uuid for them, but for other tables you'll have to set it upAnishDe12020
10/05/2021, 8:06 AMmendesrenan5
10/05/2021, 12:19 PMlarryM
10/05/2021, 1:55 PMlarryM
10/05/2021, 1:56 PMGaurav
10/05/2021, 3:37 PMchadyj
10/05/2021, 3:41 PMconst { data, error } = supabase.auth.api.resetPasswordForEmail('user@email.com')
a 404 is returned for non-existant emails.
Is there a way to not expose if the account exists or not?silentworks
10/05/2021, 5:05 PMJaeden
10/05/2021, 5:36 PMLuis Felipe
10/05/2021, 5:40 PMMichael Ketzer | streamgeist.com
10/05/2021, 6:18 PMramirez
10/05/2021, 6:54 PMsilentworks
10/05/2021, 8:16 PMkeeperpaige
10/06/2021, 5:15 AMAnishDe12020
10/06/2021, 7:49 AMint8
column to uuid
but I get this error when doing so (the table is empty)AnishDe12020
10/06/2021, 7:53 AMquambo
10/06/2021, 9:48 AMquambo
10/06/2021, 9:49 AM