https://supabase.com/ logo
Join Discord
Powered by
# help
  • m

    MDobs

    10/13/2021, 6:36 AM
    From our tests it is pretty solid so far
  • a

    almkamberi

    10/13/2021, 9:21 AM
    I just wanted to asked how to handle graphql with supabase. my frond end will be done via Flutter. I'd like to know were to start and how to implement
  • m

    Marky

    10/13/2021, 9:41 AM
    Is there a filter to find distinct from the rest api for a particular column?
  • c

    chipilov

    10/13/2021, 10:37 AM
    Supabase uses PostgREST under the hood and as far as I can tell from this GitHub issue, PostgREST does NOT yet support distinct (it's a fairly long thread so you might want to double-check my conclusion): https://github.com/PostgREST/postgrest/issues/915
  • c

    chipilov

    10/13/2021, 10:37 AM
    If I am correct, it means that your option is to do what you need to do behind a view
  • m

    Marky

    10/13/2021, 10:41 AM
    I ended up just using pagination then filter client side. It isn’t run too often and only a few thousand records, unique would make it 25% of the size
  • m

    Marky

    10/13/2021, 10:41 AM
    I have moved mostly to using pgcleint instead of supabase api as it is just easier to use sql
  • m

    Marky

    10/13/2021, 10:42 AM
    There are always things you just can’t do and rather than run two clients I just move it all to sql but in this case I didn’t want credentials.
  • j

    Johann

    10/13/2021, 4:29 PM
    Hello I am writing a new user in a table and assign him an app_role when a new user signs up, with that sql code. If a user signs up with Email and Password, I can provide metadata and assign the right app_role to him. Is there a way to do the same, when I use the OAuth Provider SignIn? In the docs there is now way to insert metadata. create function public.handle_new_user() returns trigger as $$ declare is_admin boolean; begin insert into public.users (id, username) values (new.id, new.email); select count(*) = 1 from auth.users into is_admin; if position('buyer' in new.raw_user_meta_data->>'app_role') > 0 then insert into public.user_roles (user_id, role) values (new.id, 'buyer'); elsif position('seller' in new.raw_user_meta_data->>'app_role') > 0 then insert into public.user_roles (user_id, role) values (new.id, 'seller'); else insert into public.user_roles (user_id, role) values (new.id, 'buyer'); end if; 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();
  • b

    Bryan K.

    10/13/2021, 5:17 PM
    This seems like a n00b question, but I don't have a clear answer in my head yet. Which direction should 'References' point? For example, I have a 'parent' table with a in a field UUID for that record. Then, I have another 'child' table that relates to the first table with that same UUID. Should the first table reference to the 'child' table, or does the second table reference its UUID field back to the 'parent' table?
  • b

    Bryan K.

    10/13/2021, 5:18 PM
    There is a 1:many relationship between the row in the parent table to many rows in the child table.
  • v

    Victor Peralta

    10/13/2021, 5:35 PM
    The child table should reference the parent table in this case
  • b

    Bryan K.

    10/13/2021, 5:36 PM
    I am trying to set the column in the parent table for the relationship to be Unique since that is a requirement for the relation, and I am getting
    Error: Cannot read properties of undefined (reading 'name')
  • j

    Juraj

    10/13/2021, 5:45 PM
    @User Hello. I also got this error but I just had the column edited and saved.
  • b

    Bryan K.

    10/13/2021, 5:47 PM
    I don't quite understand, what do you mean that you had the column edited and saved? I can't save the edits because of the error. Do you mean directly through the SQL?
  • j

    Juraj

    10/13/2021, 5:49 PM
    No, I just clicked on Edit column link, it opened modal with column information and when i pressed save it showed this error.
  • b

    Bryan K.

    10/13/2021, 5:50 PM
    Ah, so you think this is a bug in general and not specific to my changes?
  • j

    Juraj

    10/13/2021, 5:50 PM
    Yes
  • b

    Bryan K.

    10/13/2021, 5:50 PM
    I just sent an email to supabase about this issue.
  • j

    Juraj

    10/13/2021, 5:51 PM
    this error message does not make sense
  • b

    Bryan K.

    10/13/2021, 5:51 PM
    Agreed, there is a 'name' parameter for the column and it has a value.
  • b

    Bryan K.

    10/13/2021, 5:52 PM
    I'm thinking that for the workaround, I am going to try updating the column properties through SQL and not use the UI.
  • b

    Bryan K.

    10/13/2021, 5:56 PM
    ALTER TABLE the_table ADD CONSTRAINT constraint_name UNIQUE (thecolumn);
    worked and the box is checked now in the UI.
  • b

    Bryan K.

    10/13/2021, 5:58 PM
    But now assigning the relationship for the child table column is giving me the same error in the UI. I think I am going to wait until this is resolved.
  • b

    Bryan K.

    10/13/2021, 6:10 PM
    I couldn't wait... 😁 I added the FK relationship with this SQL.
    ALTER TABLE child_table ADD CONSTRAINT parentfk FOREIGN KEY (child_table_column_name) REFERENCES parent_table (parent_table_column_name);
  • d

    Daniel

    10/13/2021, 8:13 PM
    ok. Thanks.
  • d

    dottelsc

    10/14/2021, 1:07 AM
    I know this is a long shot, but does anyone have experience troubleshooting Twilio SMS delivery?
  • m

    MDobs

    10/14/2021, 5:48 AM
    troubleshoot how? what is the problem?
  • u

    user

    10/14/2021, 6:51 AM
    i need some help. I want to add google login to my python flask webpage or any other third party login. How can i do it ?
  • m

    Michael Ketzer | streamgeist.com

    10/14/2021, 7:03 AM
    Hey there, I have a question. - I am using supabase auth and using twitch as a third-party provider. - I have some websites the user should not be required to log in to. - The website URL contains a UUID generated for the user that is/should be secret. - This does mean I can identify the user technically with this UUID. Is it possible to log in to the user programmatically without redirecting to twitch with the UUID? I want to use the RLS features to limit the access as well. On another note, Twitch allows multiple accounts on the same email, so it does not make sense to have this as unique for Twitch OAuth. I am frequently getting logged in on wrong accounts as it matches the Email instead of the twitch id. Can this be avoided in some way?
1...108109110...316Latest