Null
01/03/2022, 10:34 PMMac
01/03/2022, 10:52 PMgetSession
instead. That way you'd be able to access both the access token and the user data:
js
const { access_token, user } = supabase.auth.session();
Null
01/03/2022, 10:54 PMconst test = JSON.parse(localStorage.getItem("supabase.auth.token"));
Null
01/03/2022, 10:55 PMNull
01/03/2022, 10:55 PMHhorn
01/03/2022, 11:57 PMthisisgoldman
01/04/2022, 12:13 AMpublic
schema.
The table I'm trying to subscribe to is in a schema called stripe
Here is how I set up the subscription:
js
const subscription = supabase
.from(`stripe.subscription`)
.on("UPDATE", (payload) => {
setUser({ ...user, ...payload.new });
})
.subscribe();
It doesn't appear to work. It looks like it prepends to the public schema. Any feedback or advice?thisisgoldman
01/04/2022, 12:29 AMrobotdood
01/04/2022, 3:52 AMcreate_profile_for_user
Postgres function when I try to access the user_metadata
object on my newly signed up user.
My profiles
table has a username
column (text) and my Postgres function looks like this:
begin
insert into public.profiles(id, username);
values(new.id, new.user_metadata.username);
return new;
end;
I'm adding user_metadata
as per the docs: https://supabase.com/docs/reference/javascript/auth-signup#sign-up-with-additional-user-meta-data
I know the data is successfully passed to the function because I can set username
to new
(instead of new.user_metadata.username
or new.data.username
or new.username
or other similar attempts) and I get something like this entered into the username
cell:
(00000000-0000-0000-0000-000000000000,3a8b9bf6-3313-4ad6-b67f-8b9eb97f5874,authenticated,"",test@email.com,$2a$10$tXkm/RwqkSgKwuy5QbvCGuwRjuSSrU/YVus.4VkwNzIbAB5.OKhyO,,,"",,"",,"","",,,"{""provider"": ""email"", ""providers"": [""email""]}","{""username"": ""my cool username""}",f,"2022-01-04 03:39:06.055591+00","2022-01-04 03:39:06.055591+00",,,"","",,,"",0)
I'm new to Postgres, but I figure my attempt to access user_metadata
with dot notation is what's failing me, does that sound right?robotdood
01/04/2022, 5:12 AMuser_metadata
in Postgres functionAlf
01/04/2022, 7:28 AMilike
when querying a table? In my case I have a text field of pipe-separated categories and I would like to look for all the rows that contain one or multiple categories, so I'd need to use multiple `ilike`srveciana
01/04/2022, 10:28 AMVarna
01/04/2022, 2:37 PMScott P
01/04/2022, 2:48 PMcodingwithmanny
01/04/2022, 2:54 PMKellen Mace
01/04/2022, 2:59 PMAnoushk
01/04/2022, 3:26 PMAnoushk
01/04/2022, 3:26 PMandyouareagone
01/04/2022, 3:53 PMmarcelcruz
01/04/2022, 5:46 PMMax Rows
value on my project's settings, but select
is still capped at 1.000.
does this change take some time to propagate or something?
thanks!
edit: it seems there's already an open issue on this matter: https://github.com/supabase/supabase/issues/4544dhruv_casa
01/04/2022, 6:27 PMwiesson
01/04/2022, 6:39 PMwiesson
01/04/2022, 6:41 PMStickSeas
01/04/2022, 6:47 PMNick
01/04/2022, 7:30 PM*@whatever.com
?Nick
01/04/2022, 7:31 PMrobotdood
01/04/2022, 8:41 PMslug
column that auto slugifies the value of another column on INSERT
and/or UPDATE
?
I attempted to add this function, but am unable to set the return type to `trigger`: https://www.kdobson.net/2019/ultimate-postgresql-slug-function/
Another option I saw in the comments of the gist (linked at bottom of that blog post) was to have a generated column a la:
CREATE TABLE person (
name text not null,
slug text generated always as (slugify(name)) stored
);
Not sure how to create a generated column within Supabase, though. Any ideas?ktosiek
01/04/2022, 9:18 PMNick
01/04/2022, 9:55 PMAmusedGrape
01/04/2022, 11:23 PM