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

    Needle

    05/20/2022, 9:27 PM
    Hello @sang.dang! This thread has been automatically created from your message in #843999948717555735 a few seconds ago. We have already mentioned the @User so that they can see your message and help you as soon as possible! Want to unsubscribe from this thread? Right-click the thread in Discord (or use the ``...`` menu) and select "Leave Thread" to unsubscribe from future updates. Want to change the title? Use the ``/title`` command! We have solved your problem? Click the button below to archive it.
    s
    • 2
    • 3
  • b

    benten

    05/21/2022, 12:19 AM
    I'm curious how use-supabase does this.
    Copy code
    // create a query and use all the postgres query options
    const query = useSupabase().from('site').select('*')
    // pass that query to useQuery and get automatic SWR revalidation on it.
    const { data: queryData } = useQuery(query)
    useSupabase() returns the supabase client. They use this to construct queries, but doesn't it make an API call as well?
    n
    g
    • 3
    • 4
  • b

    Bryan K.

    05/21/2022, 2:10 AM
    In a varchar field I have some records that are NULL and some that are EMPTY. I can create a filter to show all the records where that IS null. But I can't figure out how to do the same if the field is EMPTY. I get an 'invalid query' error if I enter
    empty
    or
    EMPTY
    .
    n
    g
    • 3
    • 18
  • a

    arcavid

    05/21/2022, 4:17 AM
    Can I use supabase client in next.js middleware?
    n
    • 2
    • 1
  • s

    sbr

    05/21/2022, 4:26 AM
    Hi, how can I redirect to a page on login that has a
    withPageAuth()
    set? That is, I'd like a user who logs in to go to the
    /home
    page but
    /home
    has a
    withPageAuth()
    requirement from
    supabase-auth-helpers
    and the redirect doesn't succeed
    n
    t
    • 3
    • 8
  • s

    sang.dang

    05/21/2022, 6:58 AM
    Hi, could someone help me on this please https://github.com/supabase/supabase/discussions/6907
    n
    • 2
    • 3
  • d

    dipesh

    05/21/2022, 10:35 AM
    Hi guys, I was trying to do http post request in postgres function. But I get the following error. Please provide your expertise 🙏
    function http_post(unknown, unknown, unknown) does not exist
    What I did? - Turn on HTTP extension - Sample Function
    Copy code
    create or replace function public.handle_new_user() 
    returns trigger 
    language plpgsql 
    security definer 
    as $$
    begin
      select 
       "status", "content"::jsonb
         from  http_post(
        'https://app.doneo.io:5000/notification',
        '{"user": new.email,"provider":new.provider}',
        'application/json'
      );
      return new;
    end;
    $$;
    n
    g
    • 3
    • 6
  • e

    edgaras

    05/21/2022, 12:13 PM
    Is there a way to bulk import simple data to Supabase?
    n
    m
    l
    • 4
    • 9
  • j

    Jingly

    05/21/2022, 12:27 PM
    I was curious, how long after postgres publishes a new stable version does supabase try to migrate to that version? I was looking through the v15 beta docs and there seems to be some interesting improvements
    n
    • 2
    • 1
  • l

    lanbau

    05/21/2022, 12:51 PM
    hi guys.. i think this might be a very basic question.. if i have a dropdown list - e.g low, medium, high.. how can i guarantee that a user cannot insert other values than these 3 items?
    n
    b
    • 3
    • 8
  • l

    lanbau

    05/21/2022, 2:23 PM
    hi team is there a way to block email alias from signing up e.g abc@gmail.com and ab.c@gmail.com.. i tried and there were 2 accounts created.
    n
    • 2
    • 1
  • d

    dipesh

    05/21/2022, 3:47 PM
    Hello devs, There is a
    new
    variable available in postgres trigger function and I can access values like
    new.email
    new.id
    . I wanted to also know about value of provider through which register was done and tried with
    new.provider
    , but couldnot retrieve. Is there any docs available regarding
    new
    variable or is there any way to log
    new
    variable in function to see what is coming. Thanks for the help 🙏
    n
    g
    • 3
    • 5
  • t

    TheOnlyTails

    05/21/2022, 4:01 PM
    I'm trying to store github profile info in a database using the JS api in a sveltekit page endpoint, but it doesn't seem to work. I've been told it might have something to do with SSR and
    window
    ? my code is here:
    n
    • 2
    • 5
  • d

    dipesh

    05/21/2022, 4:50 PM
    Hello. I am struggling to send variable to http call in postgres function. In the below snippet, email variable is not send in post request. API works if I use string value directly instead of email variable. Any help is highly appreciated. 🙏
    Copy code
    DO $$ 
    DECLARE
       email VARCHAR(50) := 'John';
    BEGIN 
    PERFORM 
        http_post(
        'http://app.doneeoo.io/notification',
        '{"type":"notify-user","data":{"user": email,"provider":"email"}}',
        'application/json'
      );
    END $$;
    n
    g
    • 3
    • 5
  • j

    Jan Tennert

    05/21/2022, 4:51 PM
    Hey! currently making a supabase client for creating jetpack compose android apps. It works perfectly fine with the authentication but my question: Once the user signs in, should I save the credentials on the phone's storage or the refresh token or whats the best way of doing that?
    n
    g
    • 3
    • 12
  • g

    gtims123

    05/21/2022, 5:36 PM
    Hi all, I am trying to listen to real-time supabase updates in my react-native app, but for some reason no matter what I do I can't get it to work. I have set up replication under supabase_realtime for all my tables last night because I noticed it wasn't enabled for all tables, thinking this would fix it. Real-time update listening is still not working unfortunately. When I print the status it says "CLOSED" by the way. I also don't have RLS enabled on my tables. Here is the code in my useEffect hook: useEffect(() => { const messageSubscription = supabaseClient .from('\*') .on("\*", (payload) => { console.log("GOT HERE") } ) .subscribe((status) => { console.log(status) }); return () => { supabaseClient.removeSubscription(messageSubscription); }; } }, []); Would appreciate any help, been stuck for a long time 😦. Real-time listening appears to only work when the code is outide of useEffect, but this would mean it makes hundreds of subscriptions (I think) which is unsustainable of course.
    n
    g
    k
    • 4
    • 5
  • s

    sang.dang

    05/21/2022, 7:18 PM
    Hi, I have a question, currently trying to follow this tutorial https://supabase.com/docs/guides/local-development#linking-your-project - I created new app, blank - I inited local blank app too. - After running
    supabase db remote commit
    , I see new file ...
    ..._remote_commit.sql
    in
    supabase/migrations
    folder, but with so weird script:
    Copy code
    DROP FUNCTION IF EXISTS graphql.cache_key(role regrole, ast jsonb, variables jsonb);
    
    DROP FUNCTION IF EXISTS graphql.build_delete(ast jsonb, variable_definitions jsonb, variables jsonb, parent_type text, parent_block_name text);
    
    DROP FUNCTION IF EXISTS graphql.build_insert(ast jsonb, variable_definitions jsonb, variables jsonb, parent_type text);
    
    DROP FUNCTION IF EXISTS graphql.build_update(ast jsonb, variable_definitions jsonb, variables jsonb, parent_type text, parent_block_name text);
    
    DROP TABLE IF EXISTS graphql._field CASCADE;
    
    DROP TABLE IF EXISTS graphql._type CASCADE;
    ....
    Is it expected? I didn't change nothing related to
    graphql
    function or extention, why does it want to drop?
    n
    • 2
    • 4
  • l

    lumen

    05/21/2022, 7:18 PM
    Hey guys! Who has experience working with Prisma and Supabase Auth? I want all my models to be defined in my Prisma schema, but I want my authentication to be handled using Supabase. I know how to set up Supabase Auth, and I know how to connect Prisma to Supabase database, but I don't know how to make them work together. As far as I understand, I should create my own Profiles table (managed by Prisma), and use Supabase trigger function to automatically create a record every time the user signs up and is added to the Users table (managed automatically by Supabase). But I don't understand how would I be able to create a relationship between these two tables, how would I create a foreign key in my Prisma schema pointing to the Users table, if the Users table is not defined in my schema, but created automatically by Supabase? Can you help me out?
    n
    g
    • 3
    • 7
  • n

    Needle

    05/21/2022, 7:42 PM
    Hello @Steve! This thread has been automatically created from your message in #843999948717555735 a few seconds ago. We have already mentioned the @User so that they can see your message and help you as soon as possible! Want to unsubscribe from this thread? Right-click the thread in Discord (or use the ``...`` menu) and select "Leave Thread" to unsubscribe from future updates. Want to change the title? Use the ``/title`` command! We have solved your problem? Click the button below to archive it.
  • h

    husK

    05/22/2022, 3:30 AM
    Hey folks, I'm tinkering around with supabase at the moment and I am exploring the RLS, I am wanting users to only access the data they enter into my tables. It is my understanding that for each table I wish to do this, I need to track the
    user_id
    in the table (with relationship to the auth table) and then have a policy that checks
    uid() = user_id_column
    Is this correct? Thanks
    n
    g
    • 3
    • 5
  • n

    Needle

    05/22/2022, 3:35 AM
    Hello @lanbau! This thread has been automatically created from your message in #843999948717555735 a few seconds ago. We have already mentioned the @User so that they can see your message and help you as soon as possible! Want to unsubscribe from this thread? Right-click the thread in Discord (or use the ``...`` menu) and select "Leave Thread" to unsubscribe from future updates. Want to change the title? Use the ``/title`` command! We have solved your problem? Click the button below to archive it.
  • l

    lanbau

    05/22/2022, 4:04 AM
    hi i'm have set the site url to redirect to http://localhost:3000/auth However the emails sent are pointing to http://localhost:3000/ not sure whether its a timing issue
    n
    • 2
    • 2
  • e

    edgaras

    05/22/2022, 6:48 AM
    Has anybody also been lately getting these "Invalid Date" for new auth users?
    n
    s
    +2
    • 5
    • 10
  • s

    selique

    05/22/2022, 9:09 AM
    i try use the policy for my tables but don't indetify the fields from auth.id (i try use ::text but dont works, i follow the https://supabase.com/docs/guides/with-ionic-react for this exemple)
    n
    g
    • 3
    • 5
  • l

    lanbau

    05/22/2022, 10:21 AM
    hi guys, is there a way to return an error if a trigger is successful. I have a trigger that is working but it doesn't return an error in the frontend.
    Copy code
    create or replace function before_user_added()
    returns trigger
    language plpgsql
    as $$
    begin
      return case
        when (EXISTS(SELECT 1 from settings where user_id = new.user_id and role = 'investor'))
        then new
        else null
      end;
    end $$;
    
    create trigger before_auth_user_created
      before insert on investors_public
      for each row execute procedure before_user_added()
    n
    s
    • 3
    • 3
  • k

    kresimirgalic

    05/22/2022, 12:38 PM
    Hey everyone, is there an option to clone the project? I want to have two different environments like dev and prod?
    n
    s
    • 3
    • 6
  • l

    lanbau

    05/22/2022, 1:07 PM
    hi i've tried multiple times sign up as an existing user and it seems to return 200 status without any errors. The expected behaviour is to have an error "user has already signed up" Any ideas what could be the issue?
    Copy code
    const { data, error } = await supabase.auth.signUp({
            email,
            password,
          });
    n
    g
    i
    • 4
    • 69
  • s

    stnmonroe

    05/22/2022, 1:10 PM
    What is the best way to have multiple Google, Github, Slack (etc) auth accounts under one? Let's say I wanted to integrate with the
    googleapis
    and import things from my personal and work calendar. Is there a best practice for this within Supabase?
    n
    • 2
    • 2
  • a

    ajbodoc

    05/22/2022, 1:11 PM
    Hello,
    n
    • 2
    • 1
  • a

    ajbodoc

    05/22/2022, 1:30 PM
    supabase link Flags: --project-ref: Project ref of the Supabase project. Where do you get that data?
    n
    g
    • 3
    • 3
1...273274275...316Latest