https://supabase.com/ logo
Join Discord
Powered by
# help-and-questions
  • supabase changelog
    j

    jinsley8

    05/12/2023, 9:09 PM
    Where can I find a proper changelog for the
    supabase
    repo? https://github.com/supabase/supabase
    o
    • 2
    • 2
  • Auth not deleting foreign keys when removing an auth entry.
    t

    ThisIsJustin

    05/12/2023, 9:22 PM
    It looks like the delete button in the webapp is not taking care of all the foreign keys when removing an auth user. Should the UI button take care of all that for us?

    https://cdn.discordapp.com/attachments/1106692845705895937/1106692845907218575/image.png▾

    g
    • 2
    • 1
  • How to reset primary key / id counter when adding new rows to a table via the table editor?
    k

    KiwiHour

    05/12/2023, 9:52 PM
    I'd like for new ones to continue on from the previous row, but there seems to be a hidden counter thats incremented. How can I reset this?

    https://cdn.discordapp.com/attachments/1106700354801909760/1106700355116466247/image.png▾

    g
    v
    v
    • 4
    • 27
  • .ilike('url', `%${url}%`) its not getting values
    f

    formigueiro

    05/12/2023, 10:41 PM
    Copy code
    js
      const reqData = await req.json()
      let { id, url } = reqData.record;
    
        const { data: urlExist } = await supabase
        .from('url_data')
        .select('id')
        .ilike('url', `%${url}%`)
    it getting empty array, but there is a item with url with that value, for example
    https://supabase.com/docs/guides/database/webhooks
    g
    • 2
    • 24
  • How can I give more than 1,000 rows? Using python library
    z

    zavbala

    05/12/2023, 11:23 PM
    Hello folks
    g
    • 2
    • 8
  • PgBouncer Errors [Using Remix + Vercel + Supabase w/ PgBouncer]
    b

    blackstock

    05/12/2023, 11:42 PM
    A new site we are working on seems to be operating fine, but once every couple minutes a random web request we will see that there is a cold reboot taking place. We haven't run into this in previous projects and are paying for the pro tiers on Vercel. The cold boots take around 15 seconds to resolve. Without coldboots, the pages resolve in a couple hundred MS. We aren't sure whats causing the very slow cold boots OR why it's happening so often. The PGBouncer, Postgres & Vercel logs are attached. We are wondering if we misconfigured PG Bouncer? There are several errors/alerts from Supabase and we aren't sure if our supabase is causing the issues OR those are happening as a result of the coldboots.. Any help would be greatly appreciated!

    https://cdn.discordapp.com/attachments/1106728178048839750/1106728178254352394/Screenshot_2023-05-12_at_5.29.46_PM.png▾

    https://cdn.discordapp.com/attachments/1106728178048839750/1106728178673799258/Screenshot_2023-05-12_at_5.33.28_PM.png▾

    https://cdn.discordapp.com/attachments/1106728178048839750/1106728179017723984/Screenshot_2023-05-12_at_5.35.50_PM.png▾

  • supabase-image-loader.js - 401 unauthorized
    b

    bhaskar

    05/13/2023, 12:38 AM
    With Next js I am getting unauthorized exception when trying to use nextjs custom loader. But works fine if i just download it with supabaseclient. appreciate any help
    g
    • 2
    • 28
  • Which Realtime extension to use for syncing a list between clients with low latency
    t

    Toe

    05/13/2023, 1:10 AM
    I'm working on an online board game akin to chess of sorts and I want to have as low latency as possible in UI changes between users when they make updates. I've been using "postgres_changes" as the source of truth to sync UI state between clients. There's definitely a bit of delay when there's multiple updates firing so I'm starting to toy with Broadcast as a faster layer to sync updates and make DB changes in the background but I'm scared it might lead to issues with syncing state. Curious what the Supa team or anyone else's thoughts are for improvements.
  • A bit confused to how edge functions work
    m

    malphine2

    05/13/2023, 2:02 AM
    Just as the title says, specifically speaking, would it be possible to invoke an edge function everytime an data base change occurs on say a table?
    v
    • 2
    • 1
  • File upload not working on Vercel
    r

    Recon1st

    05/13/2023, 4:44 AM
    I have a function that uploads an image to a storage bucket and then returns a publicURL so the front end can use it. When I deployed to vercel the function does not upload the file. I have logs to detect errors but my vercel server logs don't show the error but shows the success What would cause it to work in one environment and not the other? RLS turned off, env variables are correct and set on vercel
    g
    • 2
    • 2
  • RLS Role system
    h

    HG_SHGYT

    05/13/2023, 5:32 AM
    We have a Prisma schema that includes a profile model with an id, uid, email, firstname, lastname, and roles field. The roles field is an enum with values ADMIN, GUEST, and MEMBER. We want to create a rule that allows users to get only their own profile data unless they have the ADMIN role, in which case they should be able to get all profile data. Here's the rule we came up with:
    Copy code
    sql
    sql
    Copy code
    ((auth.uid() = uid) OR (EXISTS ( SELECT 1
       FROM profile profile_1
      WHERE ((profile_1.uid = auth.uid()) AND ('ADMIN'::roles = ANY (profile_1.roles))))))
    The first part of the rule (auth.uid() = uid) works fine and gets the user's own profile data, but we're having trouble with the second part. We want users with the ADMIN role to be able to get all profile data, but this part of the rule doesn't seem to be working. Can you help us figure out what's wrong with the rule or suggest a better way to implement this functionality?
    v
    • 2
    • 2
  • Supabase Server auth
    s

    shnoman

    05/13/2023, 9:01 AM
    Greeting Everyone, Can I use supabase auth into my server, pass the whole payload to supabase client, and start using the normally. If yes, then in which function can I pass the whole payload? The reason for doing that is that we want to use other phone auth providers currently not supported by supabase. It will be easy to use this with RLS. Thanks
  • Database Type Next.js build fail
    h

    HG_SHGYT

    05/13/2023, 10:23 AM
    the database which i generated using supabase command cause problems with my deployment

    https://cdn.discordapp.com/attachments/1106889472328613918/1106889472550899712/image.png▾

    o
    • 2
    • 13
  • auth ui
    r

    RyanLuttrell

    05/13/2023, 11:51 AM
    Anyone run into this notification using auth-ui-react when a user is signing up?? Can't seem to find anything in the documentation and I'm trying to better understand what causes it

    https://cdn.discordapp.com/attachments/1106911584699301978/1106911585047416843/IMG_2022.jpeg▾

    g
    • 2
    • 1
  • next js server side fetching with rls
    h

    HG_SHGYT

    05/13/2023, 1:15 PM
    Are there any resources or examples available that demonstrate support for RLS (Row-Level Security) in a server-side environment? Our current fetching method is failing when Next.js runs it on the server, but it works fine when we fetch it on the client side. We suspect that the issue may be related to cookies, headers, or authentication. If anyone has a working example that we could check, it would be greatly appreciated.
    g
    • 2
    • 5
  • how to conditionally render login pages w/ supabaseProvider in nextjs 13?
    d

    Dxlan

    05/13/2023, 1:17 PM
    What's up everyone - I'm building a to-do list app and want users to sign in with google before being able to create their lists. When I was using the
    /pages
    router I would just use
    session
    from the
    useSession
    hook to determine weather or not to render the login page - but i'm not sure if this is the same case when using the
    /app
    router. There's a page(https://supabase.com/docs/guides/auth/auth-helpers/nextjs-server-components) in the docs on building auth flows with nextjs 13 but on the repo it seems that the
    Login
    client component is rendered regardless of the user's auth status. Can I use the
    useSession
    hook in
    page.tsx
    ?

    https://cdn.discordapp.com/attachments/1106933186203762718/1106933186467987456/Screenshot_2023-05-13_at_8.09.52_AM.png▾

    t
    p
    • 3
    • 4
  • Contributing to auth-ui
    y

    Yuu

    05/13/2023, 1:41 PM
    I'm using svelte auth-ui in my application. There's many features missing in auth-ui library and I was thinking of contributing. I tried to make a feature request but the issue chooser takes me to the supabase discussions. What's the right way to move forward? CC: @silentworks (since they've contributed heavily to the repo; hope it's fine to ping)
    o
    • 2
    • 1
  • QStash Verify not working while native Deno succeeds
    n

    Nin

    05/13/2023, 2:06 PM
    I've made a QStash receiver in Supabase but it's not playing nice. This is my code:
    Copy code
    import { serve } from "https://deno.land/std@0.187.0/http/server.ts";
    import { Receiver } from "https://deno.land/x/upstash_qstash@v0.3.7-canary.0/mod.ts";
    import supabase from "../_shared/supabase.ts";
    
    serve(async (req: Request) => {
      const r = new Receiver({
        currentSigningKey: Deno.env.get("QSTASH_CURRENT_SIGNING_KEY")!,
        nextSigningKey: Deno.env.get("QSTASH_NEXT_SIGNING_KEY")!,
      });
    
      const payload = await req.json();
    
      const isValid = await r
        .verify({
          signature: req.headers.get("Upstash-Signature")!,
          body: payload,
          clockTolerance: 5,
        })
        .catch((err: Error) => {
          console.error(err);
          return false;
        });
    
      if (!isValid) {
        return new Response("Invalid signature", { status: 401 });
      }
    
      console.log(JSON.stringify(isValid));
    
      console.log("The signature was valid");
    
      return new Response("OK", { status: 200 });
    });
    When a message comes in, this is what my console sputters:
    Copy code
    TypeError: Failed to execute 'digest' on 'SubtleCrypto': Argument 2 is not an ArrayBuffer or a view on one
        at makeException (ext:deno_webidl/00_webidl.js:88:10)
        at Array.converters.BufferSource (ext:deno_webidl/00_webidl.js:564:11)
        at SubtleCrypto.digest (ext:deno_crypto/00_crypto.js:458:30)
        at Receiver.verifyWithKey (https://deno.land/x/upstash_qstash@v0.3.7-canary.0/pkg/receiver.ts:73:50)
        at async Receiver.verify (https://deno.land/x/upstash_qstash@v0.3.7-canary.0/pkg/receiver.ts:28:25)
        at async Server.<anonymous> (file:///home/deno/functions/hex-explored/index.ts:10:21)
        at async Server.#respond (https://deno.land/std@0.187.0/http/server.ts:220:24)
    When reaching out to QStash they made an example on Deno which was working fine. Anyone has an idea?
    • 1
    • 1
  • error updating table with rpc
    a

    aar2dee2

    05/13/2023, 2:36 PM
    I'm running into an
    "invalid json response body at https://<project-id>.supabase.co/rest/v1/rpc/update_embeddings reason: Unexpected end of JSON input
    error when making a bulk update on a table using an rpc:
    Copy code
    ts
    interface allEmbeddings {
    ada_002_embeddings: number[];
    ada_002_total_tokens: number;
    ada_002_prompt_tokens: number;
    id: string;
    }[]
    const supabaseHeaders = {
        "Content-Type": "application/json",
        apikey: supabaseKey,
        Authorization: `Bearer ${supabaseKey}`,
      };
    const updateEmbeddingResponse = await fetch(
          `${supabaseUrl}/rest/v1/rpc/update_embeddings`,
          {
            method: "POST",
            headers: { ...supabaseHeaders },
            body: JSON.stringify({
              json_array: allEmbeddings,
            }),
          }
        );
    The Postgres function code:
    Copy code
    sql
    CREATE OR REPLACE FUNCTION public.update_embeddings(json_array jsonb)
        RETURNS VOID
        LANGUAGE plpgsql
    AS $$
    DECLARE
        _record public.search_dataset;
    BEGIN
        FOR _record IN
            SELECT * FROM json_populate_recordset(null::public.search_dataset, json_array::jsonb)
        LOOP
            UPDATE public.search_dataset
                SET ada_002_embeddings = _record.ada_002_embeddings,
                    ada_002_total_tokens = _record.ada_002_total_tokens,
                    ada_002_prompt_tokens = _record.ada_002_prompt_tokens
            WHERE id = _record.id;
        END LOOP;
    EXCEPTION
        WHEN others THEN
            RAISE NOTICE 'Error occurred: %', SQLERRM;
    END;
    $$;
    If I use a simple
    update
    on the table, I'm able to update date, but I want to call the rpc to bulk update. No issues with RLS here.
    g
    • 2
    • 4
  • Allow users to verify their email after they signed up
    n

    netdesignr

    05/13/2023, 3:22 PM
    Hi, Is there any way we can allow users to sign up for an account without forcing them to verify their email address but once they are inside the application to generate a link that allows the users verify their account? React Remix + Supabase (Stack) Thank you!
    g
    • 2
    • 5
  • Supabase/Airbyte connector
    v

    ven

    05/13/2023, 3:41 PM
    I meant Airbyte. I don't see Supabase in the Airbyte list here (https://airbyte.com/connectors). Is there a different connector that Supabase is available to? Thanks
    s
    • 2
    • 11
  • trying to create webhook to call a supabase edge function
    m

    malphine2

    05/13/2023, 4:42 PM
    Hey so i am trying to create a webhook that calls my edge function. I've made it so it gets called everytime there is an UPDATE or INSERT in my table. How do i actually get a certain columns value from the row that got inserted into the table? like what would i put for value here?

    https://cdn.discordapp.com/attachments/1106984733939867668/1106984734233460886/image.png▾

    g
    • 2
    • 7
  • Help with realtime
    o

    osamita

    05/13/2023, 5:33 PM
    I ask this to supabase documentation AI, but it has answered three diferent think, so, here I am... Talking about web apps... If I as user of a chat app, if I suscribe to a channel and i close the browser tab (never execute an unsuscribe() function), and i dont enter to that app anymore, my channel will be active forever?
    g
    • 2
    • 6
  • Need help
    d

    Doc

    05/13/2023, 6:54 PM
    cannot cast type bigint[] to uuid[] when i try to link user schema to another schema through the unique indentifier?..

    https://cdn.discordapp.com/attachments/1107018127356727456/1107018232017199164/image.png▾

    g
    • 2
    • 38
  • Waiting for session to load with useSession()
    m

    MATTI

    05/13/2023, 7:41 PM
    When using useSession() from the auth-helpers-react, how do I wait for the session to be loaded? I am trying to redirect the user to sign in page, if there is no session. But it seems that the session is always NULL before the session is set to the session value or NULL. How do I make sure whether the session is actually null, and no just loading?
  • Local Gotrue not respecting Redirect URI for external OAuth
    e

    erodozer

    05/14/2023, 1:11 AM
    ignore this question, my issue was that I didn't have
    proxy_cache off;
    set on my nginx instance that was in front of my local supabase 😩
  • No module named 'postgrest'
    m

    Master5157

    05/13/2023, 8:20 PM
    Copy code
    File "C:\Users\alpla\Desktop\SUIFrogs\Chatter-Project\ChatImposter\main.py", line 30, in <module>
        from supabase import create_client, Client
      File "C:\Users\alpla\AppData\Local\Programs\Python\Python311\Lib\site-packages\supabase\__init__.py", line 1, in <module>
        from postgrest import APIError as PostgrestAPIError
    ModuleNotFoundError: No module named 'postgrest'
    I have been working with supabase for a week or so now and after some package conflicts I wanted to make a new venv and Docker later, but this error appears everytime. I've installed everything I can think of from supabase, supabase-py, postgrest, postgres, postgrest-py and a couple other ones. Any help is appreciated.
  • Uploading Base64 to Buckets
    j

    justJosuke

    05/13/2023, 8:50 PM
    Hello, I am using Draftbit and Supabase to create a social media app and I am struggling with uploading images to my buckets. I am using base64 and struggling to make a post request. Does Supabase storage accept base64 format? If so how do I send it to buckets?
    g
    t
    g
    • 4
    • 17
  • HCapctha Verification on SQL Inserts
    p

    Patrity

    05/13/2023, 9:14 PM
    I see the Hcaptcha integration with auth endpoints, however is it possible to use Hcaptcha with SQL inserts as well? I have a contact form that uses a sql insert when the form is submitted, and I'd like to have a captcha before the user submits the form. Any ideas?
    g
    • 2
    • 2
  • update policy
    t

    Tavish

    05/13/2023, 9:20 PM
    Hello everybody, I have been playing around with supabase recently and very new to all of it. I have been making a website that gives the user CRUD functionality on Items, I have the create and delete working fine but saldy the update is not working probably now I have been looking through my code and haven't seen a reason why it won't work but then I have realised that it could be the Policy on Supabase it's self. This is my code in the itemsClient.ts file for updating items
    Copy code
    ts
    
    const updateItem = async (id: string, item: Partial<IItemRemote>) => {
            const update = await client.from('items').update({
                ...item,
                id,
            }).eq('id', id)
        }
    and in images you will find the policy how it stands now I do have users has one of the columns in the items table and it works with uuid Hope anybody can give me some pointers on this issue Thank you in advance!

    https://cdn.discordapp.com/attachments/1107054683220090990/1107054683471745045/Screenshot_2023-05-13_231631.png▾

1...212213214...230Latest