https://supabase.com/ logo
Join DiscordCommunities
Powered by
# javascript
  • s

    stibbs

    09/29/2021, 11:48 PM
    Then, assuming your user passes the RLS rule, it will work. If it's still giving errors then console log the error and tell us what it is
  • r

    Rossveth

    09/30/2021, 2:19 PM
    Sorry for jumping in, but I had the same issue last night about multiple relationships and @User's answer solved it. Thanks so much, saved me a lot of headache!
  • l

    liljamesjohn

    09/30/2021, 7:19 PM
    Sorry for the late reply. If this allows supabase to know the user cookie etc, then that's what I needed. Will try and run it soon, trying to refactor my code to be cleaner 😂
  • j

    jstansbe

    10/02/2021, 2:37 PM
    Is it possible to create a folder in a bucket via javascript (supbase.js)?
  • m

    magicbyt3

    10/03/2021, 10:53 AM
    Hey all, I am wondering how to return a random row using the supabase js client. Is something Like order ('random') supported or do I have to use rpc/raw sql to do this?
    s
    • 2
    • 2
  • l

    liljamesjohn

    10/04/2021, 12:28 AM
    When clicking a password reset link sent via email, is the user meant to be logged in automatically?
  • m

    Miguel2390d

    10/04/2021, 12:44 AM
    Regarding this code
  • m

    Miguel2390d

    10/04/2021, 12:44 AM
    https://supabase.io/docs/reference/javascript/storage-from-update
  • m

    Miguel2390d

    10/04/2021, 12:45 AM
    Upsert boolean is not working
  • m

    Miguel2390d

    10/04/2021, 12:45 AM
    Error: "resource not found"
  • m

    Miguel2390d

    10/04/2021, 12:45 AM
    If it's not found it should insert it, but it doesn't
  • k

    Khan W

    10/04/2021, 12:46 AM
    I can't tell what's going on and could use some help. I've disabled email confirmation on the Supabase dashboard, but when I go to log in after signing up an existing user I always get the error message:
    Thanks for registering, now check your email to complete the process.
    And I'm not getting any email for the accounts I'm testing with :/
  • m

    Miguel2390d

    10/04/2021, 12:49 AM
    Maybe disable and enable it again
  • k

    Khan W

    10/04/2021, 12:49 AM
    yep that fixed it
  • k

    Khan W

    10/04/2021, 12:49 AM
    lmao
  • k

    Khan W

    10/04/2021, 12:49 AM
    thanks
  • m

    Miguel2390d

    10/04/2021, 12:53 AM
    You can't
  • j

    javorszky

    10/04/2021, 1:41 AM
    Hm... when querying foreign tables, how do I do cross-schema queries? I have the
    auth.users
    table, as does everyone, and created a
    public.user_relationships
    table to hold some relationships. This query works when I use the query window
    Copy code
    sql
    select u.email, ur.employee_id from public.user_relationships ur left join auth.users u on u.id = ur.employee_id where ur.manager_id = '5995b4db-e19f-4f7c-9e55-10151b8a678a';
    But how do I express that in javascript? Looking at this: https://supabase.io/docs/reference/javascript/select#query-the-same-foreign-table-multiple-times
    Copy code
    js
    const { data, error } = await supabase
      .from('products')
      .select(`
        id,
        supplier:supplier_id ( name ),
        purchaser:purchaser_id ( name )
      `)
    I've tried doing
    Copy code
    js
    const {data, error} = await supabase
                .from('user_relationships')
                .select(`
            employee_id:auth.users(id),
            employee_id:auth.users(email)
            `)
                .eq('manager_id', auth.globalSession.user.id)
    And getting this error:
    Could not find a relationship between user_relationships and users in the schema cache
    , which I think is the closest I've got The table structure is
    Copy code
    sql
    create table user_relationships (
        manager_id uuid references auth.users on delete cascade not null,
        employee_id uuid references auth.users on delete cascade not null
    );
  • j

    javorszky

    10/04/2021, 1:55 AM
    HM... It's going to be an access right thing where the anon key doesn't have permission to access the auth schema, huh?
  • j

    jason-lynx

    10/04/2021, 3:51 AM
    yes it doesnt have access to
    auth.users
  • j

    jason-lynx

    10/04/2021, 3:52 AM
    you'd need a corresponding
    users
    table in the public schema to join with the
    user_relationships
    table
  • j

    javorszky

    10/04/2021, 7:11 AM
    neat, thank you!
  • h

    Hal

    10/04/2021, 9:18 AM
    Noob question, is it better to use the sdk directly on the frontend or make an api for it on the backend? I hope I use the correct terms here
  • m

    Mihai Andrei

    10/04/2021, 9:23 AM
    You can use it in both sides. How i would do it is the following: If i need only to interact with the db, i will use it directly from frontend. If for example, i would make a PDF generator, for let's say, send a file to the server, sign it, and then save it to storage, i would make in on backend
  • h

    Hal

    10/04/2021, 10:10 AM
    I see.. So it’s more like simple or more complex use case. What about from the security aspect? Is there any difference? Cause if it’s used on the backend it can sort of mask stuffs, right?
  • m

    Mihai Andrei

    10/04/2021, 10:13 AM
    Depends. You can use RLS for securing the database from frontend. or you can make a custom logic in your api
  • h

    Hal

    10/04/2021, 10:17 AM
    Alright I think I get the gist of it, Thanks!
  • n

    noxy

    10/05/2021, 7:54 PM
    hello, is there a way to group records by specific column?
    s
    • 2
    • 16
  • n

    noxy

    10/05/2021, 7:54 PM
    or am i supposed to do it with javascript on my side
  • n

    noxy

    10/05/2021, 7:55 PM
    cause i dont see anything regarding this task in documentation
1...232425...81Latest