'"X.png
01/27/2022, 1:29 AMgaryaustin
01/27/2022, 2:25 AMgaryaustin
01/27/2022, 2:29 AMDong
01/27/2022, 3:21 AMts
supabase
.from(TABLE_NAMES.PROPERTY)
.select(
`id,title,tenant(name)&tenant.limit=1`
);
mitul
01/27/2022, 4:06 AMcory882
01/27/2022, 6:54 AMwiesson
01/27/2022, 8:59 AMconst mySubscription = supabase
.from('countries:id=eq.200')
.on('UPDATE', handleRecordUpdated)
.subscribe()
wiesson
01/27/2022, 9:01 AMproducts:id=eq.1234,products:rootId=eq.1234
so I get all products with all variants, but I don't understand the syntax here š¤·āāļø I tried to use an or
but I'm not sure if the syntax is the same as for filters for a select query?imtiaz
01/27/2022, 10:30 AMKilian
01/27/2022, 1:15 PMMarkido
01/27/2022, 1:18 PMchipilov
01/27/2022, 1:20 PMMarkido
01/27/2022, 1:21 PMchipilov
01/27/2022, 1:21 PMMarkido
01/27/2022, 1:21 PMKilian
01/27/2022, 1:27 PMricardodepaula
01/27/2022, 2:48 PMricardodepaula
01/27/2022, 2:48 PMgaryaustin
01/27/2022, 4:01 PMgaryaustin
01/27/2022, 4:14 PMgaryaustin
01/27/2022, 4:14 PMjbergius
01/27/2022, 6:46 PMpayslips
, which is just a table that holds all payslips that has been sent through my app. Every payslip is connected to a specific company through a integrator_key
which also can be found in the companies table.
I do all my queries to the payslips table through a protected API Route and not from the client. So right now I've only enabled RLS, but don't make use of any policy. My query looks like this atm:
const { data: payslipsData, error } = await supabaseAdmin .from('payslips')
ā.select('*')
.eq('integrator_key', integratorKey);
Questions:
- Is this the best and fastest query I can use? I don't want to make this call on client side, as I also fetch data from an external API at the same time, and merge together with the data from Supabase.
- Do I have any benefits from using the integrator_key
as a foreign key to the companies
table? Right now that isn't set up, don't really ask me why.gattaca
01/27/2022, 7:08 PMgattaca
01/27/2022, 7:09 PMbrandymarsh
01/27/2022, 7:26 PMconst fragments = new URLSearchParams(window.location.hash.substr(1))
const accessToken = fragments.get('access_token')
gattaca
01/27/2022, 7:27 PMbrandymarsh
01/27/2022, 7:31 PMgattaca
01/27/2022, 7:31 PMScott P
01/27/2022, 7:33 PMurl.replace('#', '?')
and then parsing the result of that (using whatever URL parsing library you prefer) will get you the paramsZiga
01/27/2022, 9:44 PMconst { error, user } = await signUp(
{
email,
password,
},
{
data: {
accountType
}
});
i am using this trigger function to add user to public table
create or replace function public.handle_new_user()
returns trigger as $$
begin
insert into public.users (id, username, email, avatar_url)
values (new.id, new.raw_user_meta_data ->> 'full_name', new.email, new.raw_user_meta_data ->> 'avatar_url');
return new;
end;
$$ language plpgsql security definer;
-- trigger the function every time a user is created
create trigger on_auth_user_created
after insert on auth.users
for each row execute procedure public.handle_new_user();
Since the extra data is stored in auth user as user_metadata, how can i modify the upper trigger function to add this data in public users table.
Thanks