Aviv
09/04/2022, 9:01 AMdhruv_casa
09/04/2022, 10:38 AMAlbertGao
09/04/2022, 10:51 AM현우Hyeon
09/04/2022, 10:59 AMCheqo
09/04/2022, 11:14 AMconst { data, error } = await supabase
.from('products')
.select('*, prices(*)')
.eq('active', true)
.eq('prices.active', true)
.order('metadata->index')
.order('unit_amount', { foreignTable: 'prices' });
Everything works, but how does it connect products with matching rows in the prices table? Products table itself has no prices
column. Prices table do have product_id
column, but how does it know automatically what to connect since we only wrote .select('*, prices(*)')
.
I would have imagined that we had to write something like connect('prices').where('product_id).eq('id')
, but it seems like it does this automatically?Denis_
09/04/2022, 11:42 AMjoshcowan25
09/04/2022, 11:44 AMweilzuvielgewalt
09/04/2022, 11:59 AM^3.0.0
is required but currently using 3.0.0-rc.8
I'm getting this after npm run dev with Nuxt 3?VuNguyen
09/04/2022, 12:13 PMXin chào
with xin chao
and xin chào
keyword?joshcowan25
09/04/2022, 1:08 PMandriusmv
09/04/2022, 1:31 PMAlbertGao
09/04/2022, 1:32 PMAlbertGao
09/04/2022, 3:41 PMconst session = await supabaseClient.auth.api.getUser(getTokenFromReq(req));
works great!
just wonder if it is the correct way, since i assume consider the user is authenticated, should not the info being fetched as well, so i do not need to waste another call?
but if my assumption is wrong, then my current way should be totally fine.
just need a confirmation, thanks 🙂AlbertGao
09/04/2022, 4:02 PMAlbertGao
09/04/2022, 4:08 PMUser|null
when should i use which? thanks 🙂Lukas V
09/04/2022, 4:37 PMsearchable
?
Let's say if I only have 300 searchable recipes and 5 million non searchable, would that impact performance in any way?InspectorT
09/04/2022, 4:50 PMtypescript
supabaseClient
.channel('db-changes')
.on(
'postgres_changes',
{ event: 'INSERT', schema: 'public', table: 'parties' },
(payload: unknown) => {
console.log('new party', payload);
}
)
.subscribe();
When I create a new row on this table in the UI on app.supabase.com, I see the event come in. When I update the client to point to the local instance, the same code does not trigger when I insert a new row in the local UI.
I have verified the replication option is enabled for the parties
table.
Any suggestions on how to debug?jon.m
09/04/2022, 7:27 PMtry_catch.js
09/04/2022, 7:53 PMpages/api/auth/setServerSideCookies.js
`import { supabase } from '@/utils/supabaseClient'
export default async function handler(req, res) {
if (req.method !== POST
) {
return res
.status(500)
.json({ message: This endpoint requires a POST request!
, status: 400 })
}
const { error } = await supabase.auth.api.setAuthCookie(req, res)
console.log('IS ERROR ????: ', error)
if (error) {
return res
.status(500)
.json({ message: error.message, status: error.status })
}
}
`
I really don't know what I'm doing wrongInspectorT
09/04/2022, 9:30 PMtypescript
supabaseAdmin
.channel('public:parties')
.on(
'postgres_changes',
{ event: 'INSERT', schema: 'public', table: 'parties' },
(payload) => {
console.log('new party', payload.record); // how to type this function?
}
)
.subscribe();
I am already passing in the generated Database
definition when instantiating the supabase client
typescript
export const supabaseAdmin = createClient<Database>(
environment.supabaseURL,
environment.supabseServiceKey
);
draco
09/04/2022, 10:01 PMhhtps://www.example.com
. Is this something that is possible?
Otherwise if it is not possible, is it at all necessary? If I want to say ensure that only people signing up from a specific domain are able to do so, how would I make that happen using RLS?dreinon
09/05/2022, 12:15 AMaaron
09/05/2022, 1:06 AMstudent:
first_name
student_club:
student_id,
club_id
club:
name
RLS for club table:
(uid() IN ( SELECT profiles.user_id
FROM profiles
WHERE (profiles.club_id = club.id)))
RLS is enabled for club
with the above rule and disabled on the other tables.
Do I need to add similar rules to the students and student_club tables? I was hoping I'd write essentially one rule and it would cover all the cases to reduce chances of bugsnukeexplosions
09/05/2022, 1:18 AMdrilkmops
09/05/2022, 1:19 AMjaitaiwan
09/05/2022, 3:39 AMAdrianMsM91 {KBL}
09/05/2022, 7:38 AMjs
const resetPasswordForEmail = async (email) => {
return await supabase.auth.api.resetPasswordForEmail(email, {
redirectTo: `${APP_HOST}/authentication/recovery-password`
});
};
Also as you can see in the settings of Supabase is everything good also, attach in the images. Any idea how can I fix it? ThanksSatou kuzuma
09/05/2022, 7:38 AMchaos
09/05/2022, 8:54 AMtangle
09/05/2022, 9:04 AM