https://supabase.com/ logo
Join Discord
Powered by
# help-and-questions
  • createServerSupabaseClient returns null even though user is authed on client side
    t

    TheBuilderJR

    02/22/2023, 9:34 AM
    Basically https://github.com/supabase/supabase/issues/12574
    s
    • 2
    • 2
  • Unable to get response from supabase - TodoList Example app
    s

    Soluxos

    02/22/2023, 10:40 AM
    For some reason I don't get any response from one of the provided functions from the example app...
    s
    • 2
    • 17
  • Anyone else having issues with supabase? It is extremely slow for the last 3 hours
    l

    lake_mattiato

    02/22/2023, 10:54 AM
    Database takes 20+ seconds to refresh, deploying edge functions also. Every other website works well, so the connection is not the issue
    b
    s
    • 3
    • 2
  • How can I do an OR query on both a foreign table field AND a table field?
    h

    hoj

    02/22/2023, 11:08 AM
    For example, I have
    Copy code
    Recipes
    ----
    id
    created_by
    Copy code
    Favorites
    ----
    id
    user_id
    recipe_id
    I would like to return all recipes that have either been created_by, or favorited by a user
    g
    • 2
    • 3
  • Really slow query results for roughly the last 6 hours.
    b

    bpeck81_

    02/22/2023, 11:39 AM
    Anyone else having this?
    h
    • 2
    • 2
  • Best Practices for schema design of a two-sided app
    c

    cryptoneur

    02/22/2023, 12:01 PM
    I am planning to design a database schema that accommodates two set of users. 1) Poker Player 2) Poker Staker The idea is that they have some info that they share, e.g. name, address etc. but also some different infos, e.g. such as a unique profile. Some real life examples would be airbnb (host/visitor), udemy (learner/educator) etc. We would have some routes, like: app.com/player/{username} app.com/staker/{username} app.com/player/{username}/dashboard app.com/staker/{username}/dashboard I am wondering if there are any best practices around schema design. Some ideas I had were wether to Create separate tables for different "users": - player_usernames - staker_usernames Or create one table with schema: - user_id, player_username, player_staker Or even sort of a user role intermediate table: auth.users: - user_id: 1 - name: Johne Doe roles: - id: 1 - name: player user_roles: - id: 1 - user_id: 1 (1-1 to auth.users) - role_id: 1 (1-1 to roles) user_role_usernames: - user_role: 1 (1-1 to user_roles) - username: pokerplayer I guess in the end all three solutions would work but, they come with advantages and disadvantages, e.g. row-level secruity and ease of data fetching, relationship look ups etc. If anoyne has any tips or hints to projects/examples out there would love to learn more! Thanks! šŸ™
  • Is it save to share the userid?
    e

    eqoram

    02/22/2023, 12:42 PM
    Hi everyone! I want to build an app where users are able to share some data by just attaching there user id in a link so others can access it. For example a favorite list that is related to the user by having the userid as a column. I was therefore wondering if it save to share the user id of a user because a lot of permission policies of other tables will be managed by making it only acceesible to one user with a specific user id (auth.id = table.userid basically).
    s
    • 2
    • 2
  • GraphQL and RLS based on user id
    b

    BenXk

    02/22/2023, 12:43 PM
    I’m trying to limit a profiles table to be limited to the user id using GraphQL. I have just used the template and allowed all actions, but I get no data back. Do I need to send the auth or something?
  • Getting wierd error after import supabase
    d

    Dembe

    02/22/2023, 12:47 PM
    Hello, when I'm trying to import supabase to a file i get this error Attempted import error: 'supabase' is not exported from '../../utils/supabase' (imported as 'supabase').
    Copy code
    js
    supabase.js file
    import { createClient } from "@supabase/supabase-js";
    
    export default createClient(
      process.env.NEXT_PUBLIC_SUPABASE_URL,
      process.env.NEXT_PUBLIC_SUPABASE_ANON_KEY
    );
    Copy code
    js
    data file
    import { supabase } from "../../utils/supabase";
      useEffect(() => {
        const getEntries = async () => {
          const { data, error } = await supabase.from("countries").select();
          console.log(data);
        };
        getEntries();
      }, []);
    `
    But i'm getting that error from this.
    b
    n
    • 3
    • 4
  • Work with Supabase locally
    i

    is farish

    02/22/2023, 1:15 PM
    When I try to run
    supabase
    locally (via
    supabase start
    ), it "kills" Docker
    s
    • 2
    • 4
  • Help needed deleting users from auth.users table
    a

    anilduri [34]

    02/22/2023, 1:25 PM
    Hello all, I'm using Supabase to help with a react native app I'm working on. I've implemented the signup functionality and was able to create a user, sign in and getting a session token no problem. After deciding to cleanup my database a little, on the dashboard I delete the users I signed up with and got a success message on all of the. However when I click Reload in the Users tab in authentication those users I just deleted are still there.. Within the SQL Editor I execute **select * from auth.users** I'm able to see all users, even the one's I deleted on the dashboard I've attempted to remove these users through the SQL Editor, by deleting from both their ids and emails but I'm met with this response. Failed to run sql query: column "anil@gmail.com" does not exist Wondering is there something I've missed on how to properly remove a user from Supabase's auth.users table?
  • auth request return error 500.
    d

    dev Joakim Pedersen

    02/22/2023, 2:28 PM
    We have a quite damaging issue with auth. My colleague has talked to support but it's been working out to great. so hoping anyone here got a idea! When a new user sign up I get this in logs. an error saying public.users do not exist. Last registration was the 4th of february. I have not done any changes codewise that would affect it on frontend. but we have tried some things with SMTP and DNS settings to look for the cause. and I did not find this before today. but checking back I could go to the 17th and this had gone one daily. about 1 to 3 times. which is around the amount of new daily users. So now it's at a hault really. Here is the log of the 500 error. Log Event Message {"component":"api","error":"failed to close prepared statement: ERROR: current transaction is aborted, commands ignored until end of transaction block (SQLSTATE 25P02): ERROR: relation \"public.users\" does not exist (SQLSTATE 42P01)","level":"error","method":"POST","msg":"500: Database error saving new user","path":"/signup","referer":"https://www.virtualia.shop/","remote_addr":"80.203.15.73","time":"2023-02-22T11:39:51Z","timestamp":"2023-02-22T11:39:51Z"} Also may or may not be related to it. but a few times a day I get two warnings.
    DEPRECATION NOTICE: GOTRUE_JWT_DEFAULT_GROUP_NAME not supported by Supabase's GoTrue, will be removed soon
    DEPRECATION NOTICE: GOTRUE_JWT_ADMIN_GROUP_NAME not supported by Supabase's GoTrue, will be removed soon
    They usually follow up right after this error.
    prometheus server (0.0.0.0:9122) shut down
    So it seems that a server shuts down. and it boots up again right after, and then I get these warnings. Probably nothing but thought it wise to share Hope anyone got a idea, bit rough without registration working :/
    g
    • 2
    • 15
  • Google OAuth Verification requires 'supabase.co' domain ownership
    s

    snagna

    02/22/2023, 2:51 PM
    I am making a Chrome Extension for Google Drive, thus my Google OAuth configuration includes sensitive scopes to use Google Drive API. However, since I set '[project-id].supabase.co/auth/v1/callback' as a redirect URI (as written in Supabase dev docs), Google requires proof of ownership for 'supabase.co' domain via Google Search Console (suggesting configuring TXT or CNAME record). How can I solve it?
    s
    • 2
    • 1
  • supabase-js: is it possible to select a function as part of the query?
    i

    interfacelab

    02/22/2023, 3:40 PM
    Is is possible to translate something like this into something callable with the js client:
    Copy code
    select posts.*, heat_score(column_a, date_created) as heat_score from posts;
    Where
    heat_score()
    is a postgres function. Views don't work here because I need to do some joins.
    • 1
    • 1
  • How to create a local development user with password?
    s

    Sarcodo

    02/22/2023, 3:43 PM
    I've setup a local database and have used the
    seed.sql
    file to create sample data, however I can't login with the sample user I created to be able to see the users data. Is there a way to create a user with an encrypted password via the seed script, or is there another alternative way of doing this?
    s
    • 2
    • 1
  • Multiple POST / PUT requests? Front end or back end?
    u

    Unknown Member

    02/22/2023, 3:51 PM
    This is slightly off topic, and leans towards doing best practices, but what are your experiences and best practices when sending multiple POST/PUT requests? Do you do it all on the front end or in the back end? front end - sending 10 individual requests, or sending 1 individual request with 10 items in the body and the backend can handle it? TIA!!! ā¤ļø ā¤ļø ā¤ļø
    s
    • 2
    • 1
  • How do I remove a check from a column?
    s

    Soluxos

    02/22/2023, 4:06 PM
    This may seem really dumb, but in the todolist tutorial you run an sql query to create the table for the todos. In this we create a check that the task has a minimum of over 3 characters. Is there a way to remove this check from the UI? Or am I going to need to use SQL?
    s
    • 2
    • 3
  • RLS Policy Error
    f

    fadethegap

    02/22/2023, 4:15 PM
    I just started a new project and when I tried to run this sql:
    Copy code
    CREATE POLICY "Only Authenticated users can Insert" ON public.profile FOR INSERT WITH CHECK ((role() = 'authenticated'::text));
    It resulted in this error:
    Failed to run sql query: function role() does not exist
    I used the sql from a previous project, which worked fine. Is there a setting I need to change?
    g
    • 2
    • 2
  • Trigger Function Error 42P01
    j

    Jarvis

    02/22/2023, 4:25 PM
    Hello! I've been looking in documentation, and not able to find an answer yet, so I figure it's best to just ask for help after spending this much time and effort on it. This function is triggered when a review is added to the reviewee table:
    Copy code
    begin
      -- increment the number_of_ratings for this user
      UPDATE public.profiles
      SET number_of_reviews = number_of_reviews + 1
      WHERE id=(new.reviewee.id::text)::uuid;
      -- update user overall rating by averaging 
      return new;
    end;
    As a first step, I just want to increment the total number of reviews, but I'm getting this error:
    {code: '42P01', details: null, hint: null, message: 'missing FROM-clause entry for table "reviewee"'}
    My mental model is obviously broken here because I don't understand why I need a FROM or how I would use it since I'm not using any information from the reviewee table. šŸ¤” When I run this query, I get the intended result: UPDATE public.profiles SET number_of_reviews = number_of_reviews + 1 WHERE id='' I could really use some adult supervision here, especially for fixing my mental model and (hopefully) finding pithy documentation for plpgsql functions. I'm obviously a noob, and I GREATLY appreciate help! Thank you!
    g
    • 2
    • 19
  • _jsonb showing up in dashboard...would like same "edit jsonb" button as above
    d

    Domcario

    02/22/2023, 4:33 PM
    is it
    _jsonb
    because this is an array? wondering how i would be able to get the same edit jsonb button as above. mainly so i can view the jsonb contents in that nice window the dashboard has
  • signInWithOTP in local development
    d

    drewbie

    02/22/2023, 4:53 PM
    I am trying to add signInWithOTP and have it send a MagicLink. Is the only way to actually login by getting the token from the inbucket port and applying that token to your app? Its tough while developing locally do that everytime and I was wondering if theres a way to bypass that for local development. Similar to how you can bypass the email verification process while testing login. Any help is appreciated
    s
    • 2
    • 1
  • What RLS policy should I use in this case?
    m

    Monimolimnion

    02/22/2023, 5:09 PM
    I have a Sveltekit app that is a booking system for training courses. I have an
    orders
    table in my SB database ready to go, but I'm not sure what security policy to use. I don't have users as such, the app just needs to insert into the database 'by itself'. The only template for inserting data in the dashboard is for authenticated users.
    g
    • 2
    • 10
  • How to enable RLS for users before email is verified
    j

    jj_sessa

    02/22/2023, 5:11 PM
    Im looking to add data such as name, company, etc to a public profiles database with RLS enabled BEFORE the user verifies their email. Is there a way to check for an un verified user in a rls policy and let them insert data? It seems as if the auth.uid() = id() policy is not letting unverified users through.
    g
    • 2
    • 6
  • nextjs + react native auth
    l

    LucasReinaldo

    02/22/2023, 5:14 PM
    hey there, is it possible to have supabase auth and manage an api + web + react native app with nextjs and react native?
    s
    • 2
    • 5
  • add accounts from a token
    a

    aleemrehmtulla

    02/22/2023, 5:53 PM
    hi! in firebase, i can do this hackaround for things like discord auth, where i send them to their auth link, and on success then create a fake email/password account. then when i sign in, i can grab their account using the
    admin
    serverside stuff. how can i do the same with supabase? trying to implement figma auth :D so basically want to sign in a user from serverside without their auth if that makes sense
  • How to manage the Database size?
    r

    R1ky68

    02/22/2023, 6:02 PM
    Hi, i'm new to Supabase and my project is Read-Only because i've exeded the 500MB given. The thing is: I have used 74MB until now (which I actually don't see where) and now I see the database has 512MB of storage. How is that? Can I choose to not expand the storage?
    g
    • 2
    • 1
  • Errors with Production account - Authentication returning 504 error
    a

    alex-visto

    02/22/2023, 6:04 PM
    Good afternoon! We are seeing some weird errors with our production account - but our staging account works totally fine. When a user tries to sign in, we keep getting a 504 error response from supabase If we hit the endpoint:
    /auth/v1/token?grant_type=password
    It returns: status_code 504
    The upstream server is timing out
    We have tried rebooting our Supabase project, rebooted our servers, and the issue persists. We do use Cloudflare, and I am pretty sure Supabase uses Cloudflare as well, as we have be intermittently getting Cloudflare errors when loading our frontend app. Is anyone else experiencing this currently?
    g
    • 2
    • 3
  • File Provider in Supabase
    g

    Guille

    02/22/2023, 6:20 PM
    How can I create a file provider that can access the bucket assigned to my client in Supabase storage, and display the obtained response in the Syncfusion File Manager?
    g
    • 2
    • 13
  • Using PostgrestFilterBuilder 'or' filter with an JSONB array
    j

    jh

    02/22/2023, 7:09 PM
    Hi all, Any advice on how to create the right string to query a JSONB object that is an array? I have the following:
    Copy code
    ts
      orQuery.push(`name.ilike.%${q}%,address->>"street".ilike.%${q}%`);
    This works fine when I want to find a person whose name is 'blah' or live on the street 'blah'. Note, that the column 'address' is also a JSONB object, just not an array. I tried adding the following:
    Copy code
    ts
      orQuery.push(`name.ilike.%${q}%,address->>"street".ilike.%${q}%,contacts->>"name".ilike.%${q}%`);
    This however, fails. Any suggestions?
    g
    • 2
    • 6
  • Examples of GitLab CI for Supabase?
    s

    StartupDevDG

    02/22/2023, 7:14 PM
    I'm working on setting up a new Supabase project (our first), setting it up to automatically deploy in GitHub was pretty easy, but we've been using GitLab for all our projects and would like to stick with it. But I'm finding pretty much zero documentation for that. Are there any good examples of a .gitlab-ci.yml file for deploying Supabase out there?
1...141142143...230Latest