DanMossa
04/12/2022, 1:56 PMsupa okezie
04/12/2022, 6:09 PMpolls
table with some columns in my database. After some time, I added a number_of_votes_received
column that defaults to 0 and is updated by a trigger to the polls
table.
When I make a GraphQL query where this column is included, it works well. However, when I try to get the value of number_of_votes_received
in the GraphQL query, it returns an error "Unknown field 'number_of_votes_received' on type 'polls'."
I have checked over and over again and I am certain that there is a number_of_votes_received
column. Do you know anything that may have caused this behaviour?DeadlyDev
04/12/2022, 7:12 PMsambor
04/12/2022, 8:56 PMuseEffect(() => {
const todosSubscription = supabase
.from('todos')
.on('*', payload => console.log(payload))
.subscribe()
return () => {
supabase.removeSubscription(todosSubscription)
}
}, [])
Needle
04/12/2022, 9:55 PM/title
command!
We have solved your problem?
Click the button below to archive it.Invader
04/12/2022, 9:57 PMGuaco
04/12/2022, 10:51 PMtimeforpoptarts
04/13/2022, 12:48 AMcreate policy resource_users_manage on public.resources
for all using (public.resources.id in (select resource_id from public.resource_users where auth.uid() = user_id))
with check (public.resources.id in (select resource_id from public.resource_users where auth.uid() = user_id));
Ape R Us
04/13/2022, 7:04 AMimport supabase from '$lib/db';
export const get = async () => {
try {
const { data: events, error } = await supabase
.from('event')
.select('*')
.eq('user_id', auth.users.id));
if (error) throw error;
return {
body: {
events
}
};
} catch (e) {
console.log({ e });
}
};
pocin
04/13/2022, 9:09 AMstjepan
04/13/2022, 12:05 PMusamichizuru
04/13/2022, 3:40 PManon_123
04/13/2022, 3:55 PMrobin
04/13/2022, 7:55 PMapp.supabase.auth.user()
still returns the cached null
user, and the app thinks you haven't signed in. If you reload, everything works fine. What's the best way to fix this?justinjunodev
04/13/2022, 9:46 PMdreinon
04/13/2022, 10:59 PMlrnecgcysiam
04/14/2022, 2:25 AMoiojin831
04/14/2022, 3:56 AMoiojin831
04/14/2022, 3:57 AMMuezz
04/14/2022, 4:43 AMStored Procedures
for all possible queries in my app and stop using designated querying methods, would it matter? Especially in terms of time to load the data.akito
04/14/2022, 5:02 AMDate
from TypeScript which gets converted to a timestamp
, but when I select from the table it gets returned as a string
of what I'm assuming is a timestamp. Is there any native support for automatically converting those types back to Date
, or should I use a number
instead?oiojin831
04/14/2022, 7:59 AMnew row violates row-level security policy for table "buckets"
this error message, when I try to create bucket from "local development"?
should I setup something?
Could anyone give me some instruction how to use storage in local development? It seems like it doesn't have studio ui
Thank youusamichizuru
04/14/2022, 10:37 AMeoin
04/14/2022, 10:44 AMreturning: minimal
on the insert call, but I still get blocked by RLS (code 42501
).
The user has role: authenticated
and aud: authenticated
when I log it to the console, so I'm having a hard time figuring out where the disconnect is. 🤔 Any and all help is appreciated! 🙏
[0] https://supabase.com/docs/reference/javascript/insert#notesNeedle
04/14/2022, 12:30 PM/title
command!
We have solved your problem?
Click the button below to archive it.Needle
04/14/2022, 12:35 PM/title
command!
We have solved your problem?
Click the button below to archive it.jar
04/14/2022, 1:56 PMcreate or replace function test() returns void as $$
declare
new_username text;
begin
new_username = generate_available_username();
insert into public.profiles(belongs_to_person_id, username)
values('9395c81d-ff88-421e-9d8a-5a31675d4418', new_username);
end;
$$ language plpgsql
select test()
it adds a profile with a username fine. But if i use a function which Id like to do sign up fails. Does my trigger version look correct? Are there rules in triggers Im not aware of?
declare
new_username text;
begin
new_username = generate_available_username();
insert into public.profiles(belongs_to_person_id, username)
values(new.id, new_username);
return new;
end;
I have a trigger that creates a person on user sign up and on person signup create profile. Do they prevent too many strung together tasks or something? Although without including usename it woks fineDaniel for ze revolucija69
04/14/2022, 3:17 PMDesertRodent
04/14/2022, 3:34 PMKoen
04/14/2022, 4:15 PM