https://supabase.com/ logo
Join Discord
Powered by
# help-and-questions
  • Seed production programatically?
    z

    ziggybit

    05/16/2023, 1:22 PM
    I want to seed the remote instance with each deployment but it's not really clear how. For local development the docs discuss the
    seed.sql
    file. But I want something similar for production to populate the application with a set of necessary models. Creating a migration for this seems less than ideal. If the shape of the models change then the seed migration breaks. It really needs to be a standalone file like
    seed.sql
    . Interested to hear how others have populated their production database and how they do it in a way that isn't manual and tedious for each deployment.
    v
    • 2
    • 13
  • multiple column text search help.
    r

    RubensNobre

    05/16/2023, 1:49 PM
    Hi folks I'm trying to implement a conditional fetch structure using some examples I've found. But I can't figure out how to do a textsearch in multiple columns using this structure. here's what I'm doing: let templates: any = supabase .from('templates') .select('id, image, video, metadata, product_id!inner(*)') .eq('online', true) .eq('product_id.online', true) .eq(
    ${onlineHost}
    , 'published') .eq(hostData.hostCode, true) .eq('dmca', false); if (search) { templates.textSearch('tags', search, { type: 'websearch' }); } const { data, error } = await templates; ---- I'd like to be able to search in two columns: tags AND caption. Does anybody have any tip ? Thanks in advance
    • 1
    • 1
  • Can I somehow enable deno --unstable in edge functions?
    r

    reno

    05/16/2023, 1:53 PM
    A library I use (deno postgres) cannot init a
    Pool
    class because it requires
    --unstable
    flag. The resulting error is:
    Copy code
    Unstable API 'Deno.connect'. The --unstable flag must be provided.
    v
    t
    • 3
    • 7
  • How to correctly initiate a new schema to DB with correct permissions?
    r

    reno

    05/16/2023, 2:00 PM
    The issue: I've found it confusing and hard to "replicate" the public schema without official documentation. What I would want to do, is to create another schema with exactly the same (or similar) permissions and functionality as the public schema - so when I would connect to the DB (and to my new schema), it would work/behave identically as public does. Supabase has roles, permission and other context that isn't really explained in technical detail on how one should take those in to account when creating other schemas. There are a few issues or posts about the subject if you google the subject, but they are either old/deprecated, or don't really explain what and why you have to use some SQL statements to (for example) get permissions fixed, or to allow newly created tables to FK reference auth schema. The goal: Have a step-by-step README, a guide page in the docs or something similar that documents how one should create a new schema to supabase the "supabase way" - meaning permission, triggers, functions and whatnot work as expected. Familiarity with PSQL would be assumed. Example: Below is an example to give an idea how one would start when creating their own schema in a local supabase instance, editing seed.sql.
    Copy code
    -- supabase/seed.sql
    CREATE SCHEMA foobar;
    
    -- TODO: create a user? any other context for security?
    
    -- Add permissions
    GRANT ALL PRIVILEGES ON ALL TABLES IN SCHEMA foobar TO bar, baz; -- Are all these needed? Is this good/bad practice?
    ALTER DEFAULT PRIVILEGES IN SCHEMA foobar GRANT ALL ON TABLES TO foo, bar;
    ALTER DEFAULT PRIVILEGES IN SCHEMA foobar GRANT ALL ON FUNCTIONS TO foo, bar;
    ALTER DEFAULT PRIVILEGES IN SCHEMA foobar GRANT ALL ON SEQUENCES TO foo, bar;
    -- ...
    
    CREATE TABLE my_table (
      id serial PRIMARY KEY,
      name text NOT NULL
    );
    --- etc.
    g
    • 2
    • 11
  • clear session
    f

    formigueiro

    05/16/2023, 2:40 PM
    after logout session its no cleaning what could do?
  • [SOLVED] Confirmation E-mail from Supabase gets sent to the "Junk" folder
    j

    Johnny Robert

    05/16/2023, 3:18 PM
    Hello, I've just migrated my website/ Flutter app to my new Supabase project and used the same settings as I had in the old project however now the confirmation email gets sent to the junk folder everytime instead of being sent to the inbox folder like it did earlier today and until now, before making the switch to the new supabase project. I'm posting screenshots with the settings comparision as well.
    g
    • 2
    • 22
  • Bypass Row Level Secutiry
    t

    talpiven

    05/16/2023, 3:35 PM
    Does any one know if this suppose to bypass row level security in my edge function + has a link to the docs to see some more info?

    https://cdn.discordapp.com/attachments/1108055037508321392/1108055037831291010/image.png▾

    g
    • 2
    • 6
  • latest supabase upgrade, issues with storage
    n

    nimo

    05/16/2023, 4:06 PM
    I'm seeing this when I route to storage buckets with the latest supabase (v1.61.0). Anyone else getting this issue / know how to resolve it? It won't let me add to buckets or upload content, I keep getting errors.

    https://cdn.discordapp.com/attachments/1108062945012895744/1108062945172271215/Screenshot_2023-05-16_at_9.05.11_AM.png▾

  • Does SupaBase support email aliases on supabase.com? (SaaS)
    m

    Milou

    05/16/2023, 4:11 PM
    Hi, someone sent me an invite to a Supabase organization via an my address that looks like supabase+myname@domain.tld. app.supabase.com prompts me to register a new account with the email, but I can't, seemingly because these types of aliases are not supported. Any plans on changing that? Since invites do support them, as I get the mail.
    g
    • 2
    • 3
  • Run migration locally manually
    b

    bombillazo

    05/16/2023, 4:42 PM
    Hello, posting related to my earlier inquiry (https://discord.com/channels/839993398554656828/1108007115588653138) How can one run a specific migration file? We want to reconcile changes done in different branches where incoming changes must run on a local database that has diverged from the dev branch.
    • 1
    • 1
  • its not iserting image file
    f

    formigueiro

    05/16/2023, 5:17 PM
    im passing this file from
    Copy code
    js
    .upload(`${currentUser.id}/${imageName.value}.${extension.value}`, fileInput.value, {
        cacheControl: '3600',
        upsert: false
      })
    but files in storage as a text

    https://cdn.discordapp.com/attachments/1108080694435008623/1108080694573400074/image.png▾

    https://cdn.discordapp.com/attachments/1108080694435008623/1108080694825070692/image.png▾

    g
    • 2
    • 132
  • Is supabase react docs compatible with create-react-app and not vite?
    b

    bookvacuum

    05/16/2023, 6:04 PM
    Don't want to go through migration to vite, but docs assume app is created with vite.
    g
    • 2
    • 3
  • How to run Supabase Edge functions which require user login?
    a

    alex_

    05/16/2023, 6:23 PM
    Hi all! I'm trying to get a better conceptual understanding for the following: Can Supabase Edge functions be triggered by a signed in user (email + password) via a CURL command? The context is that I'm thinking about setting up an edge function which generates a cryptographic signature for a passed in JSON which returns that signature to the user. The signature returned is specific to the user, such that the user needs to be authenticated. I assume the JS library and others as provided by Supabase can do this directly, the question though aims at doing this with a CURL command. To break down one step: Can a user login via Supabase Gotrue through CURL? Thanks in advance for any suggestions!
    g
    • 2
    • 2
  • DB Migration Between Two Projects: Local -> Staging -> Production
    g

    Grantly

    05/16/2023, 7:42 PM
    I have two Supabase projects "Staging" and "Production". I have no problem making changes and pushing those migrations to Staging; however, after Q.A. (when I am ready to push them to production), I am struggling to push these changes to production. In short, my remote commit is associated with "Staging". Does anyone have any advice on handling database migrations from Local -> Staging -> Production? Thanks in advance.
  • PKCE with SvelteKit
    e

    Edan

    05/16/2023, 7:55 PM
    We've been facing an issue using PKCE with SvelteKit, and I'd love to learn how people are going about this. https://github.com/supabase/gotrue-js/issues/678
    s
    • 2
    • 1
  • Event Stream in Edge Function
    t

    turulix

    05/16/2023, 8:06 PM
    Hey! I'm trying to return an event stream from an edge function to keep the client UpToDate with the state of the request, which might take longer to execute. But trying this dosn't seem to work. Not sure if i'm doing something wrong or this just dosn't work at all.
    Copy code
    ts
    import { corsHeaders } from "../_shared/cors.ts"
    import { serve } from "https://deno.land/std@0.168.0/http/server.ts"
    
    serve(async (req: Request) => {
        if (req.method === "OPTIONS") {
            return new Response("ok", { headers: corsHeaders })
        }
        let timerId: number | undefined;
        console.log("Serving request")
        const body = new ReadableStream({
            start: (controller) => {
                timerId = setInterval(() => {
                    console.log("Sending data")
                    controller.enqueue(new TextEncoder().encode("data: hello\r\n\r\n"));
                }, 1000);
            },
            cancel(){
                if (typeof timerId === "number") {
                    clearInterval(timerId);
                }
            }
        })
    
        return new Response(
            body,
            {
                headers: {
                    ...corsHeaders,
                    "Content-Type": "text/event-stream"
                }
            }
        )
    })
  • Google Auth showing my supabase URL
    t

    tk

    05/16/2023, 8:55 PM
    Hello, When users try to use google auth potential users are seeing this... which is my supabase url. Does anyone know how to fix this? I read a few stack overflow posts, but didn't find anything concrete

    https://cdn.discordapp.com/attachments/1108135716652855316/1108135717235859536/image.png▾

    g
    • 2
    • 10
  • Data on table doesn't return in graphQL collections.
    b

    bruno_kiafuka

    05/16/2023, 9:05 PM
    Hi there, I'm trying out the Supabase graphQL feature and it seems that my data isn't being returned. The table I am querying isn't empty. Am I missing anything?
    Copy code
    js
    # My Query
    query {
      countriesCollection(first: 1) {
        edges {
          node {
            ...CountryFragment
          }
        }
      }
    }
    
    fragment CountryFragment on countries {
      country_code
      country_name
      currency_code
      flag
      id
    }
    
    # Response
    {
      "data": {
        "countriesCollection": {
          "edges": []
        }
      }
    }
    When I test it on the SQL Editor on Supabase dashboard, I get the correct info:
    Copy code
    sql
    select graphql.resolve($$
        {
          countriesCollection(first: 1) {
            edges {
              node {
                country_code
                country_name
                currency_code
                flag
                id
              }
            }
          }
        }
    $$);
  • Content Detection with Supabase?
    j

    justJosuke

    05/16/2023, 9:21 PM
    I was wondering if there is a way of monitoring content using Supabase. Our team is currently running into problems with scalable content moderation. We worry that our application may run into an abundance of people posting profane or illegal content. We were wondering if there is a quicker way to detect profanity, nudity, gore, and other unlawful posts using our Supabase database. If this would not be possible through Supabase, is there a way to use a content detection ai to go through our database? Maybe even go through the postings before being sent to the database?
  • Uploading from path
    l

    lennard.

    05/16/2023, 9:52 PM
    (Fixed)
  • Deadlock Detected when running update query
    m

    mansedan

    05/16/2023, 10:31 PM
    Hey we are getting an error that a deadlock was detected and we are trying to narrow it down. It happens when we run this function:
    Copy code
    sql
    UPDATE events_odds_api
      SET home_team_id = (
        SELECT id
        FROM teams
        WHERE (CASE WHEN events_odds_api.sport = 'mma_mixed_martial_arts' or events_odds_api.sport = 'soccer_uefa_champs_league'
                    THEN name
                    ELSE CONCAT(name, ' ', mascot)
              END) = events_odds_api.home_team
        LIMIT 1
      )
      WHERE home_team_id IS NULL;
    The general overview of the tables is that
    events_odds_api
    has 2 columns pointing to
    teams
    . Columns
    away_team_id
    and
    home_team_id
    These relations are set by the function above, by matching the value of column `home_team`/`away_team` with either the column
    name
    or
    CONCAT(name, ' ',mascot)
    from the teams table. Why is this causing a deadlock?
    g
    • 2
    • 8
  • Supabase (JS) Client returns empty array when Supabase function returns correct table
    r

    Ruzelmania

    05/16/2023, 10:32 PM
    I have a Supbase function that pretty simply sorts through some rows in a table and returns a new table with two labeled values when I select the function through the Supabase SQL UI. However, when I call the same function from the Supabase client and just JSON.stringify it, I get '[]'. I've tried just about everything I can think of. The Supabase chatAI is making bonkers-obvious suggestions. Can anyone else suggest something I should look for?
    g
    • 2
    • 5
  • PgBouncer
    b

    blackstock

    05/16/2023, 10:44 PM
    What are healthy PgBouncer logs suppose to look like? We only see "login attempt" and "Closing because" in our pgbounder logs.. Is that normal? Trying to troubleshoot some really funky serverless function connection issues right now and this caught our attention.

    https://cdn.discordapp.com/attachments/1108163054908223508/1108163055088586863/Screenshot_2023-05-16_at_4.42.30_PM.png▾

    n
    l
    • 3
    • 16
  • Provide User Data from Provider (Stream, State, Future)
    p

    Philipp_Nut

    05/16/2023, 10:52 PM
    Hello, I am using the auth and database from Supabase. I have an auth user and a account entry with the same uid. Now I want to provide this data across the App. I need a few times this user object. I am currently using the Futureprovider which loads everytime. What is the best approach for using a provider ? The state not changes a lot. So the Stateprovider would be best ?
    w
    • 2
    • 15
  • Advantages to joining .rpc calls?
    r

    Ruzelmania

    05/16/2023, 11:07 PM
    Is there ever an advantage to making multiple .rpc calls inside a JS Supabase client other than mildly more organized code? Is there any performance advantage that anyone is aware of?
    • 1
    • 1
  • Auth Helper won't show Reset Password flow
    a

    anon3498723894

    05/16/2023, 11:21 PM
    I'm working on my auth flows in Next.js app, and I'm using the Auth UI component. But, everytime I visit my page, it auto-logs me in and shows the LeadsPage component (see code) instead of the Update Password view of the Auth component. This happens even in Google Chrome Incognito Mode Would appreciate any help here!
    • 1
    • 2
  • how can I encrypt files so only the user can access it using storage?
    s

    salzar

    05/16/2023, 11:25 PM
    I want to make it so that they are encrypted, in a form that I myself cant see the files in the dashboard. Does anyone know if that’s an option with supabase storage, or is there some way I can do it with a 3rd party tool?
  • NestJS + Supabase: invalid sub claim after setting header on supabase createClient
    n

    newbie001

    05/16/2023, 11:40 PM
    Hi Folks, I am building an app with supabase and nestJS. I want to use prisma for querying the database but still use the supabase-js client on the backend to handle authentication and files. My frontend authenticates with supabase-js client well and generates a access_token, which I then retrieve to make requests on my custom nestjs backend. I have a
    createClient
    method on my backend as in the image below, but for each request, the
    supabase.auth.getUser()
    method returns
    invalid claim: missing sub claim
    I also tried to retrieve the session with supabase.auth.getSession but I get
    null
    supabase-js version:
    2.21.0

    https://cdn.discordapp.com/attachments/1108177251666776265/1108177251880681522/image.png▾

    g
    • 2
    • 5
  • Flutter project with Supabase Auth API - reset password for email doesnt work
    c

    cartcolombia

    05/17/2023, 12:21 AM
    I used the reset password function from Flutter, It is supposed to work but at the end it allows me to enter with old password
  • Realtime 403 error started 14h ago
    b

    broux

    05/17/2023, 12:39 AM
    We are using realtime and since 14h ago , the request to connect the websocket (
    /realtime/v1/websocket
    ) is failing with a 403 error. We haven't changed the code on our end. On client side we see this error log every 3 seconds:
    WebSocket connection to 'wss://<our supabase project code>.supabase.co/realtime/v1/websocket?apikey=xxxxxxxxxxxxxx&vsn=1.0.0' failed:
    Seems like something was changed in our project that is now causing this error to occur? We have two projects (identical, one is for dev, one is for prod) and it is only happening on our prod supabase project.
    g
    • 2
    • 62
1...216217218...230Latest