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

    abelsoares

    10/04/2021, 3:36 PM
    Hi! Does
    supabase-js
    support queries with a different schema than
    public
    ? I have created tables with a diferent schema but i see no way to specify it in the queries
  • d

    DeadlyDev

    10/04/2021, 3:58 PM
    Copy code
    created_at | timestamp with time zone | timestamptz    
    id | uuid | uuid    
    receiver_id | uuid | uuid    
    sender_id | uuid | uuid    
    status | integer | int4    
    updated_at | timestamp with time zone | timestamptz
    Both receiver_id and sender_id are foreign keys to user.id and both primary keys. I am trying to query this relationship table by user id, get back the relationship and the user for both receiver and sender for each relationship. I have tried a ton of combinations but this is currently what I have which seems to get me the closest so far.
    Copy code
    const { data, error } = await supabase
            .from('users')
            .select(
                `
                    id,
                    sender:relationships.sender_id ( * ),
                    receiver:relationships.receiver_id ( * )
                `,
            )
            .eq('id', `${user.id}`);
    Any advice or help would be greatly appreciated. Edit (Self answer) - for those who need this type of query in the future, I was going about it backwards. While it breaks from other relationship querys you do actually want to query from relationships then use the foreign keys to get the users data.
    Copy code
    const { data, error } = await supabase
            .from('relationships')
            .select(
                '*, sender:users.sender_id (*), receiver:users.receiver_id (*)',
            );
  • s

    Steve

    10/04/2021, 6:32 PM
    @User Make sure to update your syntax to:
    Copy code
    const { data, error } = await supabase
            .from('relationships')
            .select(
                '*, sender:users!sender_id (*), receiver:users!receiver_id (*)',
            );
    Using a dot
    .
    on the embedded resource is deprecated, use
    !
    instead.
  • s

    SaltyPotato

    10/05/2021, 6:09 AM
    o/ I have the code below (JS) and I need to somehow use .eq() to check if the authenticated user's id (string) matches the userid column (UUID)... does anybody know how i can do that?
    Copy code
    js
    let { data, error, status } = await supabase
                    .from('venues')
                    .select(`name`)
                    .eq('userid', user!.id)
                    .single();
    Apologies if this is blatantly obvious but I couldn’t seem to find the answer anywhere on the internet so I thought you all might be able to help
    j
    a
    • 3
    • 2
  • j

    jason-lynx

    10/05/2021, 6:35 AM
    are you getting an error from that snippet?
  • j

    jason-lynx

    10/05/2021, 6:37 AM
    or are you asking about how to get the authenticated user's id?
  • s

    SaltyPotato

    10/05/2021, 6:45 AM
    I’m just getting 406
  • s

    SaltyPotato

    10/05/2021, 6:45 AM
    Which I understand to be nothing was found
  • j

    jason-lynx

    10/05/2021, 6:54 AM
    eq uuid
  • a

    AnishDe12020

    10/05/2021, 7:28 AM
    Does Supabase auto-fill the id (uuid) field when a row is inserted or do I need to manually fill it (and if so, how do I generate one with js/ts?)
  • j

    jason-lynx

    10/05/2021, 8:02 AM
    it depends on the table - if you've set it to have it generated by default, then you wont have to manually fill it
  • j

    jason-lynx

    10/05/2021, 8:03 AM
    this part when you try to create a new column
  • j

    jason-lynx

    10/05/2021, 8:04 AM
    for user sign ups that go into
    auth.users
    , supabase creates a uuid for them, but for other tables you'll have to set it up
  • a

    AnishDe12020

    10/05/2021, 8:06 AM
    oh ok
  • m

    mendesrenan5

    10/05/2021, 12:19 PM
    How to check if the connection to supabase api is OK (with ssl and security stuff)? Sorry, I don't understand much about the web protocol... But I having issues about having an Invalid Certificate
  • l

    larryM

    10/05/2021, 1:55 PM
    does a user still need to validate their phone number if they sign up with a email too?
  • l

    larryM

    10/05/2021, 1:56 PM
    Also - whenever I pass an email and phonenumber to the auth signup, it doesnt save the user email - it just goes through the phone number otp process and says the user needs to verify their phone number on the supabase auth dashboard
  • g

    Gaurav

    10/05/2021, 3:37 PM
    Can I Add data to two table at once ?
  • c

    chadyj

    10/05/2021, 3:41 PM
    Re: Password reset. We are implementing a password reset feature, but it looks like the API calls leak data on if the account exists or not in the console, which is a bad security practice (see the OWASP guidelines). After running
    Copy code
    const { data, error } = supabase.auth.api.resetPasswordForEmail('user@email.com')
    a 404 is returned for non-existant emails. Is there a way to not expose if the account exists or not?
    s
    • 2
    • 2
  • s

    silentworks

    10/05/2021, 5:05 PM
    Reset password for email
  • j

    Jaeden

    10/05/2021, 5:36 PM
    Bump! I would like to know.
  • l

    Luis Felipe

    10/05/2021, 5:40 PM
    Hi folks, I have a problem with my RLS... I have Supabase running on local environment with Docker, I enable RLS but not working when test it with Postman, but if I do the same with the online database everything goes well. Can someone help me?
  • m

    Michael Ketzer | streamgeist.com

    10/05/2021, 6:18 PM
    Hey there, a quick question: Does supabase already support realtime subscriptions with RLS?
    s
    • 2
    • 2
  • r

    ramirez

    10/05/2021, 6:54 PM
    Hi guys, im using supabase locally with docker, yesterday was working fine but today suddenly I lost all my database
  • s

    silentworks

    10/05/2021, 8:16 PM
    RLS and realtime
  • k

    keeperpaige

    10/06/2021, 5:15 AM
    Not too sure of this, but would I be able to use the Spotify api with supabase and make requests to the api? Thank you !
  • a

    AnishDe12020

    10/06/2021, 7:49 AM
    Ok so I am trying to convert an
    int8
    column to
    uuid
    but I get this error when doing so (the table is empty)
  • a

    AnishDe12020

    10/06/2021, 7:53 AM
    nvm, dropped that column and made a new column 😄
  • q

    quambo

    10/06/2021, 9:48 AM
    Hi, I think I found a bug in the UI if you have a jsonb column with lots of data inside.
  • q

    quambo

    10/06/2021, 9:49 AM
    I'm on pro tier, and on settings, the DB instance is on constant 100% usage
1...101102103...316Latest