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

    knoppoly

    07/26/2022, 7:31 PM
    Hi folks, anyone know if we can use the rest api to join across a schema? I'm using this to join - curl 'https://dgyettclccosbbccdhva.supabase.co/rest/v1/clients?select=some_column,other_table(foreign_key)' \ - and now I need to fetch user emails in the 'auth' schema
    n
    g
    • 3
    • 3
  • s

    stevharve

    07/26/2022, 8:02 PM
    I am trying to make a database function to update a user's username, the rpc is successful but nothing is updated and no data/error is returned from the rpc call.
    n
    g
    v
    • 4
    • 9
  • g

    gorbypark

    07/26/2022, 10:56 PM
    I changed the name of a table, updated the code of the subscription to reflect that, but the realtime subscription no longer works. The websocket connection to the server is good. Any idea what to do now?
    n
    j
    g
    • 4
    • 5
  • d

    duggiemitchell

    07/26/2022, 11:15 PM
    Hi there! I've been having trouble last couple days connecting to my project on the dashboard and local dev api calls are failing with a 500 error. I'm able to auth, etc on prod.
    n
    s
    • 3
    • 2
  • g

    gesusc

    07/27/2022, 12:24 AM
    Anyone have any ideas why when running Nextjs locally I have to login on every app reload? Every time the app refreshes (due to code changes) I have to re-authenticate. I am currently signing in via email/password. I had another project that was also using Nextjs that didn't have this problem. That one was using magic links instead of email/password if that would make any difference.
    n
    s
    g
    • 4
    • 16
  • b

    b----nessmen

    07/27/2022, 2:48 AM
    Hi everyone, I am pretty new to web dev for like API's (especially in Typescript) and stuff, and I am making function that will be hosted on supabase functions that has to fetch data from different server. Data pretty much doesn't change at all, so fetching it on every request would be just wasteful, so my question is: what would be the best way to handle that situation? Long term caching? Or maybe just fetch it once before deploying, and add it directly to function like a file or something? Would second thing be ever possible for functions like this?
    n
    s
    • 3
    • 6
  • j

    Jude

    07/27/2022, 5:15 AM
    Hi friends i'm following this youtube video on one to many relationship

    https://www.youtube.com/watch?v=5VrF9OVQ6rg▾

    And I'm having trouble on merge those two tables into one query in client where in I'm trying to fetch a multiple items from table B that is connected to table A, There isn't also any resources I couldn't find elsewhere
    n
    s
    • 3
    • 2
  • c

    Cervantes

    07/27/2022, 8:06 AM
    Hi everyone, I'm having an issue with Realtime and I can't wrap my head around what's going on. I've created my tables in the SQL editor and imported them to my project with 'prisma db pull'. At first everything was working as it should however after I added another table within my 'schema.prisma' and pushed it to supabase with 'prisma db push', Realtime stopped working. Currently I'm only receiving DELETE messages and it seems they are malformed because I'm getting this error from transformers.js: 'TypeError: Cannot convert undefined or null to object'. I'm using an enum in one of my tables and thought that might be the problem but according to https://github.com/supabase/supabase/issues/5685 it shouldn't be a problem anymore. Does anyone know what the cause might be? I'm using the latest versions of both Prisma and supabase-js
    n
    • 2
    • 1
  • e

    Epailes

    07/27/2022, 8:58 AM
    Is there any difference in performance between rest api queries and graphql queries? Best I can find is here https://supabase.com/blog/2022/03/29/graphql-now-available: 377.4 requests/second through the API (mean) 656.2 queries/second through SQL (single connection, mean) I'm not sure if the rest api and graphql api should be considered identical or if there's differences?
    n
    o
    • 3
    • 2
  • e

    Eret1k

    07/27/2022, 10:27 AM
    Hello. Is there any way to use clock or interval to trigger edge functions from supabase, for example once a week to call a certain function.
  • b

    b----nessmen

    07/27/2022, 10:53 AM
    Can I use
    Copy code
    serve({
      "/": home,
    });
    async function home(request: Request) { ... }
    with functions? Because when it's served locally, it works completely normal, but when I try to deploy, it doesn't work anymore.
    n
    g
    • 3
    • 20
  • h

    hannesnussmueller

    07/27/2022, 11:14 AM
    hello. i have a very basic question so sorry for bothering you with it. i'm starting now with supabase and have two tables (
    stores
    and
    products
    ). a store can have multiple products. products table has columns like
    price
    and
    stock
    . in the stores table the products column references to the products table. when i want to add a row in stores, i cannot enter data for
    stock
    and
    price
    as this is coming from the products table already. how can i solve this? i'm not good with sql.
    n
    g
    s
    • 4
    • 3
  • t

    theuknowner

    07/27/2022, 11:16 AM
    Hello, Is it possible to scale Supabase without an external postgres database? (create multiple instances of supabase (self hosting) and connect to internal database)
    n
    • 2
    • 1
  • h

    Hallidayo

    07/27/2022, 12:37 PM
    Hi guys, are their any guides on handling RLS with Supabase and Prisma? I know by default Prisma uses a postgres admin user for a direct connection to the database but was wondering what sort of ways people have handled RLS with Prisma?
    n
    n
    • 3
    • 10
  • g

    gorbypark

    07/27/2022, 2:20 PM
    is there a better way to chain queries than doing something like this?
    Copy code
    js
    await supabase
          .from('user_addresses')
          .update({is_primary: false})
          .match({is_primary: true})
          .then(() =>
            supabase
              .from('user_addresses')
              .update({is_primary: true})
              .match({id: addressId}),
          );
    n
    n
    g
    • 4
    • 10
  • e

    Embm

    07/27/2022, 2:35 PM
    Hi all! I'm building a sveltekit app and up until now I've been managing supabase request from the client side, but I'd like to switch that to server-side handling using endpoints to allow user-specific SSR and proper redirects based on various supabase-related criteria (user's role from a
    public.users_profiles
    table and query results when querying various RLS-enabled tables, i.e redirect client if a specific
    select
    returns empty). From my understanding, the easy way to implement this implies initing (and disposing?) a new supabase client on a per-request basis and using the sveltekit client's request cookies for authing the sb call. I was wondering, are there any performance pitfalls that could come out of this?
    n
    g
    • 3
    • 3
  • b

    b----nessmen

    07/27/2022, 2:49 PM
    Hi again, maybe little stupid question, but what does Storage egress mean? Does it like for example: If I make bot that sends photos, and I will use storage for sending, it counts that?
    n
    g
    • 3
    • 3
  • f

    franfernandez

    07/27/2022, 3:12 PM
    Hi all 🙂 !! Some of you guys know if there is some way to configure the email templates (confirm sign up, Invite user, reset pass, etc) to be translate for different languages?. Using the default browser language or by the region.
    n
    g
    • 3
    • 2
  • d

    DoggoBot

    07/27/2022, 3:50 PM
    Hello everyone, im using Prisma to handle my db migrations rather than manually creating the table, although one thing I have yet to figure out is how to handle RLS with the migrations, any suggestions there?
    n
    s
    • 3
    • 21
  • s

    sante | kiftdao

    07/27/2022, 4:49 PM
    Hey, longtime firebase user, new to supabase, really excited to build with it! I'm working on adding discord oauth, I've noticed the
    access_token
    gets returned via a hash route using
    #
    instead of a query param using
    ?
    which I'm not sure how to parse correctly, I think its not matching a path in react-router which causes the app to refresh which loses the access_token. It's really weird, I can see the access_token in the url and then it disappears.
    n
    s
    • 3
    • 13
  • z

    zenny.eth

    07/27/2022, 4:58 PM
    What is a safe pattern to use with nextjs so you don't share the service key with the frontend? I've been exporting an anonClient & in another file i have a serviceKeyClient but I'm worried the serviceKey might be leaked to the frontend even if I only use it in API routes. Has anyone done this pattern safely before?
    n
    s
    • 3
    • 5
  • q

    qbit

    07/27/2022, 5:19 PM
    Where does Supabase stand on HIPAA compliance? I building something new, but need HIPAA compliance from day one.
    n
    o
    • 3
    • 4
  • s

    sylar815

    07/27/2022, 5:24 PM
    I want to import a csv file to existing supabase database, what's the best way? I can import when creating a table, but later on it's not available.
    n
    g
    • 3
    • 10
  • w

    Waldemar

    07/27/2022, 6:29 PM
    I'm failing to make the RLS work. The policy works fine when I replace
    auth.uid()
    with a hardcoded real user UUID, so it seems to be OK apart from the
    auth.uid
    part. Then I've seen on GitHub and in the source code of the
    auth.uid()
    function that it will be deprecated and that I should Use auth.jwt() -> ''sub'' instead (...two ticks is a typo...?), so I've modified my policy to:
    Copy code
    ALTER TABLE profile ENABLE ROW LEVEL SECURITY;
    CREATE POLICY "Enable users to read their own profile"
    ON profile for SELECT USING (
      profile.user_id == (auth.jwt()->>'sub')::uuid
    )
    but then I'm getting this error in Supabase:
    Failed to run sql query: operator does not exist: uuid == uuid
    I've also tried
    auth.jwt()->'sub'
    and casting
    profile.user_id
    to text, but no luck.
    n
    g
    +2
    • 5
    • 16
  • s

    stevharve

    07/27/2022, 6:38 PM
    For some reason the update in my function isn't running.
    n
    g
    s
    • 4
    • 82
  • t

    theuknowner

    07/27/2022, 8:08 PM
    What's the default postgresql.conf and hba.conf of Supabase self hosted?
    n
    • 2
    • 1
  • c

    cptCrunch

    07/27/2022, 8:39 PM
    I don't remember what change I made but now I cant send recover password emails from supabase.
    n
    g
    • 3
    • 11
  • b

    bhaskar

    07/27/2022, 9:29 PM
    Hi team, i am getting Email signups are disabled for newer signup. i have it enabled on the settings. not sure why it still show this up.
    n
    g
    • 3
    • 4
  • t

    tEjAs

    07/28/2022, 12:44 AM
    Hello! Do we have to use RLS in our tables? The way my app currently works is a user signs in from the frontend and if their username and password are correct, I use session authentication (they get a cookie with their userID) so that the user can only access tables that they have permission to access to. For example, every time a user requests to add a product for example, I will make sure that they have permission to do this. My question is if I leave on default settings for Supabase security will this app be production ready? Thanks!
    n
    g
    w
    • 4
    • 12
  • h

    HEAVYPOLY

    07/28/2022, 12:57 AM
    Hi all, I'm getting a 500 error when trying to pass a cookie like this:
    Copy code
    import { supabase } from "../../../utils/supabaseClient"
    import cookie from 'cookie';
    
    const handler = async (req, res) => {
        const { user } = await supabase.auth.api.getUserByCookie(req);
    
        if (!user) {
            return res.status(401).send("Unauthorized");
        }
        // res.send(user);
        const token = cookie.parse(req.headers.cookie)['sb-access-token'];
        
        supabase.auth.session = () => ({
            access_token: token,
            token_type: 'Bearer',
            user
        });
    
        const { data: { stripe_customer }} = await supabase
            .from('profile')
            .select("stripe_customer")
            .eq("id", user.id)
            .single();
            
        res.send({
            ...user,
            stripe_customer,
        });
    };
    . Is there something I'm doing wrong here? if I console log the token I get a long string of random letters and numbers
    n
    g
    • 3
    • 3
1...308309310...316Latest