Lukas
11/19/2022, 6:21 PMKTibow
11/19/2022, 6:55 PMjs
temp0
.channel('*')
.on('postgres_changes', { event: '*', schema: '*' }, payload => {
console.log('Change received!', payload)
})
.subscribe()
nothing happens when i edit a row with realtime on and rls select enabled from the supabase ui
one thing i noticed was that it was sending a null access token, any ideas on how to get it to use the auth with realtime?UCDFiddes
11/19/2022, 8:12 PMjson
{"code":"22P02","details":"Token \"2d01f68a\" is invalid.","hint":null,"message":"invalid input syntax for type json"}
draco
11/19/2022, 8:53 PMMozes
11/19/2022, 9:01 PMRalph
11/19/2022, 9:22 PMLufyCZ
11/19/2022, 9:56 PMswr
, however, this is not possible for subscriptions. I've got a hook that takes care of everything (initial fetch, updates using useReducer
) which works perfectly when used once, problem is, if I want to consume the same data in multiple components (not in a parent-child relationship), it starts acting up for some reason (+ there's no point fetching the same data n times anyway).
Anyone know how to handle this? Would really appreciate it ^^iStun4Fun
11/19/2022, 10:26 PMTaeyang Kim
11/19/2022, 11:45 PMjopfre
11/20/2022, 1:45 AMnew.raw_app_meta_data->'role'
I get null.
If I raise log '%', new.raw_app_meta_data;
I get {"provider": "email", "providers": ["email"]}
.
Whereas in auth.users.raw_app_meta_data I can see {"role":"admin","provider":"email","providers":["email"]}
.
Why is my role not available within the new
object?bennypc
11/20/2022, 2:31 AMjacobL
11/20/2022, 2:41 AMandreterron
11/20/2022, 2:50 AMbennypc
11/20/2022, 3:11 AM49Ryann
11/20/2022, 3:37 AMwanderexplorer
11/20/2022, 9:15 AManggoran
11/20/2022, 9:24 AM->
.
const { data, error } = await supabase
.from('users')
.select(`
id, name,
address->city
`)
If we want to query multiple keys of JSONB, how can I do that? Can I do something like this to prevent repetitive?
address -> (city, district, postcode)
MaGnezij
11/20/2022, 10:44 AMbimsina
11/20/2022, 2:02 PMSpoonz
11/20/2022, 5:01 PMyarn upgrade
on my project and it's throwing an error from the Supabase CLI package during rebuilding.
error D:\project\node_modules\supabase: Command failed.
Exit code: 1
Command: node scripts/preinstall.js
Arguments:
Directory: D:\project\node_modules\supabase
Output:
Downloading https://github.com/supabase/cli/releases/download/v1.14.3/supabase_1.14.3_windows_amd64.tar.gz
node:internal/process/esm_loader:94
internalBinding('errors').triggerUncaughtException(
^
[Error: EEXIST: file already exists, link 'D:\project\node_modules\supabase\bin\supabase.exe' -> 'D:\project\node_modules\supabase\bin\supabase'] {
errno: -4075,
code: 'EEXIST',
syscall: 'link',
NMS
11/20/2022, 5:05 PMSmardrengr
11/20/2022, 5:52 PMselect
1. games organized by me (I am the organizer)
2. games organized by one of my friends (open to friends)
3. games I'm playing in (joined)
I can easily write the query in regular SQL:
select games.* from games where games.organizer_id = session.user.id
or games.organizer_id in (select friends.friend_id from friends where friends.user_id = session.user.id and friends.accepted = true)
or games.id in (select players.game_id from players where players.user_id = session.user.id);
...But cannot see how to do it using the Supabase API.
Peaking into two foreign tables games → players
and games → friends
with where clauses, Is it even possilbe?
If not, maybe I could achieve the above with an RLS policy?! Any tips or suggestions are very appreciated.theravenstone
11/20/2022, 6:24 PMjs
const user = useSupabaseUser();
const client = useSupabaseClient();
let { data: events, error } = await client
.from('events')
.select('id', 'title', 'description', 'created_by')
console.log(events)
Mozes
11/20/2022, 7:09 PMkomagata
11/20/2022, 7:39 PMredwookie
11/20/2022, 9:29 PMsixfour
11/20/2022, 10:29 PMgtims123
11/21/2022, 12:29 AMJames Blond
11/21/2022, 3:38 AM4. Postgres inspects the JWT to determine the user making the request.
question: when it says "postgres inspects the JWT", does postgres actually query the database to match a stored JWT ? or how postgres "inspects" the JWT?
thank you in advance for the answers[GodderE2D]
11/21/2022, 4:38 AMfnuvrlvsrpjvtcilxeit