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

    mellson

    06/16/2022, 11:22 AM
    I have two projects where Function Hooks aren't visible under the database. Are they deprecated? If not how can I enable them?
    n
    • 2
    • 4
  • w

    weilzuvielgewalt

    06/16/2022, 11:44 AM
    Hey guys 👋 I want to use Supabase for an admin area in my application, but I couldn't find a way to add a user within the supabase backend? There should be no public register route
    n
    o
    • 3
    • 6
  • s

    Sagieq

    06/16/2022, 11:55 AM
    Hi, I'm having an error saying - Payload values do not match URL in primary key column(s), and this is what I did to update my user data const response = await axios.put("https://odbdnnohjmaybjdceqlo.supabase.co/rest/v1/users?id=eq." + user.id, { column: user.value }, { headers: { 'apikey': config.SUPABASE_KEY, 'Authorization':
    Bearer ${config.SUPABASE_KEY}
    , 'Content-Type': 'application/json', 'Accept': 'application/json', } }) I really appreciate the help 🙂
    n
    o
    g
    • 4
    • 58
  • c

    cooper

    06/16/2022, 3:48 PM
    Hi. What would be the best practices to implement Auth in a chrome extension?
    n
    o
    b
    • 4
    • 7
  • h

    hemantgangolia

    06/16/2022, 5:13 PM
    Hi - Is it possible to specify multiple filters while creating a realtime subscription? Example - const mySubscription = supabase .from('countries:id=eq.200, countries:id=eq.100') .on('UPDATE', handleRecordUpdated) .subscribe()
    n
    j
    g
    • 4
    • 6
  • n

    ngs

    06/16/2022, 6:19 PM
    Having trouble successfully updating/creating a password for a user signed in/authenticated by magic link in a simple sveltekit setup. The const
    { data, error } = await supabase.auth.update({ password: "password" });
    workflow throws a
    401 (Unauthorized) Password update requires reauthentication
    error. My function is dead simple:
    Copy code
    const updatePassword = async () => {
      try {
        const { user, error } = await supabase.auth.update({
          password: "password"
        });
        if (error) throw error;
        updateMessage = `Password updated: ${new Date()}`;
      } catch (error: any) {
        updateMessage = `${error.error_description || error.message}`;
      } finally {
        loading = false;
      }
    };
    The same approach is successful for updating email (triggers the 2 step confirmation path) and metadata. I've also tried using the
    supabase.auth.api.updateUser(accessToken, {password: 'password'})
    , which returns the same error. Additional wrinkle:
    supabase.auth.update()
    doesn't return the error when passed
    password: undefined
    . And it successfully updates metadata when the payload is:
    { password: undefined, data: { hello: 'world' } }
    n
    s
    • 3
    • 8
  • t

    TobTobXX

    06/16/2022, 8:38 PM
    Is there a simple way to send email confirmation / password reset / magic link emails etc in multiple languages? I found the templates page, but I can only enter one template. Can I supply the language in the sign up request to somehow send different emails? I'd need to send English emails to English customers and German emails to German customers (and possibly others). Seems like a common problem, or do others solve it differently?
    n
    g
    • 3
    • 6
  • d

    dbristow

    06/16/2022, 8:42 PM
    What is the limit/point when Supabase starts experiencing issues from too many subscriptions? For example if I have 30,000 subscriptions spread out between users for Supabase/Postgres to either a row or table, will it be 30,000x slower than normal? Has any had experience with thousands of subscriptions?
    n
    g
    • 3
    • 4
  • p

    poutingemoji

    06/16/2022, 11:41 PM
    im trying to connect to my supabase db from prisma in my code and from pgadmin but both return an
    unexpected response from login query
    error. any ideas on what the problem may be?
    n
    s
    • 3
    • 3
  • l

    liljamesjohn

    06/17/2022, 12:38 AM
    I am building a financial website that allows users to view realtime quotes of assets; Such as stocks. I am going to be updating around 1,000 rows every 15minutes. I need to add a realtime subscription so they get the most recent quotes as they are updated.... my only problem is; That would cause them to be sent all 1,000 rows when maybe they only need 5 specific quotes. Is there any way I can filter the subscription for specific rows by id?
    n
    g
    • 3
    • 4
  • f

    FED

    06/17/2022, 1:46 AM
    Hi, how am I supposed to use types from extensions with the visual editor? like postgis' point
    n
    g
    • 3
    • 3
  • f

    farzad

    06/17/2022, 2:47 AM
    Hello friends, my app has stopped working in production [no code changes]
    Copy code
    The input string ended unexpectedly / invalid input syntax for type json
    my payload
    Copy code
    {
      "completed": false,
      "prizes": [],
      "type": "daily",
      "url": "https://youtu.be/6Ypk95FaOFQ",
      "createdBy": "910b7452-7532-4ee2-9168-334bf6123cd6"
    }
    n
    s
    • 3
    • 3
  • f

    farzad

    06/17/2022, 2:58 AM
    it still enters the data into the db, but returns the error, i've got my payload down to the absolute min and still saying "invalid input syntax for type json"
    n
    • 2
    • 1
  • f

    farzad

    06/17/2022, 3:05 AM
    i'm getting all sorts of errors on other pages
    Copy code
    message":"Error in $: not enough input
    not sure what to do here when i havent updated the supabase dependency, or any other code 😒
    n
    g
    • 3
    • 3
  • b

    beepboop

    06/17/2022, 4:48 AM
    Getting 406 JSON object requested, multiple (or no) rows when RLS is enabled on Supabase I have looked at various solutions on StackOverflow, github issues in supabase, supabase/postgrest-js, postgRESTPostgREST/postgrest, and searched the Discord as well. But none of the solutions have been working so far. The code works as expected, but as soon as I turn on RLS on Supabase. The request will return the below 406 error.
    Copy code
    js
    export const supabase = createClient(process.env.NEXT_PUBLIC_SUPABASE_URL, process.env.NEXT_PUBLIC_SUPABASE_ANON_KEY)
    
    const { data, error } = await supabase.from('profiles').select('*').eq('id', userId).maybeSingle()
    // const { data, error } = await supabase.from('profiles').select('*').eq('id', userId).limit(1).single() // works when RLS disabled
    // const { data, error } = await supabase.from('profiles').select('*').eq('id', userId).single() // works when RLS disabled
    Response before RLS
    Copy code
    js
    {
        "id": "123-123-1241-1231",
        "created_at": "2022-06-10T03:59:22.751125+00:00",
        "is_subscribed": false,
        "interval": null,
        "email": "scott.tj.yu@gmail.com"
    }
    Response after turning on RLS
    Copy code
    js
    {
        "message": "JSON object requested, multiple (or no) rows returned",
        "details": "Results contain 0 rows, application/vnd.pgrst.object+json requires 1 row"
    }
    I've tried schema reload, re-implement the policy, but none's been working so far. I have a "profile" table its "id" column referencing the "auth.users.id". The policy's target role is currently "anon" but I've tried "authenticated" as well.
    Copy code
    (uid() = id)
    I also tried to change the table name to "profiles" (plural) instead of "profile" but no luck.
    n
    g
    • 3
    • 4
  • o

    omar

    06/17/2022, 6:18 AM
    how would you model the data for
    user
    , therapy
    sessions
    ? would that be a
    m2m
    relationship? I'd like to maybe show a
    history
    timeline for user interactions. Is that a separate table with
    user_id
    session_id
    ?
    n
    s
    • 3
    • 6
  • d

    Dembe

    06/17/2022, 9:30 AM
    Hello guys, in my storage, gallery bucket i have set it to public, what happends if i make it private, can I still show all my images and upload to storage?
    n
    g
    • 3
    • 2
  • l

    lyqht

    06/17/2022, 10:13 AM
    hello folks, i need some help with setting up supabase auth redirect url on a vercel deployed app. on local dev works fine, but when I tried deploying to https://unfork.vercel.app/ and adding the additional url as shown in screenshot, when i click the button Sign in with Github, it populates with a link like "https://unfork.vercel.app/#access_token=_____" but doesn't do anything. what am i doing wrong? 😆
    n
    • 2
    • 3
  • j

    jonesy-dev

    06/17/2022, 10:14 AM
    Hi, I've hit a dead-end trying to use google auth on expo/react-native. I've followed the auth guides, and the deep dive vids on Google Auth. On a browser I'm redirected to localhost:3000 with an access token and on expo go app/android emulator nothing happens when I run wait supabase.auth.signIn({ provider: 'google', });
    n
    • 2
    • 1
  • d

    Dembe

    06/17/2022, 10:53 AM
    Hello, when uploading images to storage, like
    Copy code
    const avatarFile = event.target.files[0]
    const { data, error } = await supabase
      .storage
      .from('avatars')
      .upload('public/avatar1.png', avatarFile, {
        cacheControl: '3600',
        upsert: false
      })
    I have a path like categories/sport/football, Do i need to have public first, then categores/sport/fotboll? Or does it work, because when i upload now, i get error, but when i added public before i didnt get an error but it still uploads in both ways.
    n
    g
    • 3
    • 2
  • s

    Shoki

    06/17/2022, 11:29 AM
    hi, trying to signIn with Open ID Connect Credentials but i'm getting this error :
    Copy code
    [Unhandled promise rejection: Error: You must provide a OpenID Connect provider with your id token and nonce.]
    Here is the code:
    Copy code
    js
      const { error } = await supabase.auth.signIn({
          oidc: {
            id_token: googleAuthSession.idToken!,
            provider: "google",
            nonce: "",
          },
        });
    i am passing provider, so why is it complaining ?
    n
    • 2
    • 1
  • l

    Lior539

    06/17/2022, 1:26 PM
    Im having some problems writing a Row Level Policy for the following: I have a
    users
    table. A user has an
    id
    field (foreign key on
    auth.oid()
    ) and also a
    company_id
    I want to write a RLP such that a user can select the row for any other user provided they are in the same company (i.e have the same
    company_id
    ) I wrote the following statement, but the problem is that I get an infinite recursion error (which makes sense). Anyone know how I would be able to achieve my desired RLP?
    Copy code
    (id = uid()) OR (company_id = ( SELECT users_1.company_id
       FROM users users_1
      WHERE (users_1.id = uid())
     LIMIT 1)))
    n
    g
    • 3
    • 4
  • t

    TobTobXX

    06/17/2022, 1:48 PM
    Hey there! How do I turn on realtime? I only need to receive 'new' events, so the
    alter table "your_table" replica identity full;
    is not the one I'm looking for. The docs on
    .on().subscribe()
    mention I can turn it on by [managing replication](https://supabase.com/docs/guides/api#managing-realtime), but that link (more specifically the anchor to this section) doesn't exist. Did the docs change?
    n
    • 2
    • 3
  • n

    Nditah

    06/17/2022, 2:17 PM
    I ran the command grant all on auth.identities to postgres, dashboard_user; Yet I still get pg_dump: error: query failed: ERROR: permission denied for table schema_migrations pg_dump: error: query was: LOCK TABLE realtime.schema_migrations IN ACCESS SHARE MODE
    n
    s
    • 3
    • 3
  • j

    João Vitor

    06/17/2022, 2:31 PM
    Does anybody see something wrong with this function?
    Copy code
    sql
    BEGIN
      IF NOT EXISTS(SELECT 1 FROM cart WHERE user_id = auth.uid()) THEN
        INSERT INTO cart (user_id, total) VALUES (auth.uid(), 0);
        INSERT INTO cart_item (cart_id, product_id, user_id, quantity)
        VALUES (
          new.id,
          new_product_id,
          auth.uid(),
          new_quantity
        );
      ELSE
        UPDATE cart SET total = old.total + new_quantity * (SELECT price FROM product WHERE id = new_product_id)
        WHERE user_id = auth.uid();
    
        UPDATE cart_item 
        SET quantity = old.quantity + new_quantity 
        WHERE product_id = new_product_id AND user_id = auth.uid();
      END IF;
    
      RETURN new;
    END;
    n
    g
    • 3
    • 47
  • t

    trebor

    06/17/2022, 2:35 PM
    Hey all, I'm stuck on an issue with writing to database and I don't think my setup can get any simpler but it's still not working. Including pictures of the table I'm trying to write to and the code I'm using to insert. The url that is being generated by the supabase client to POST to looks like it's possibly wrong: https://my-url.supabase.co/rest/v1/simple?columns=%220%22
    n
    s
    • 3
    • 4
  • h

    Hero

    06/17/2022, 5:17 PM
    Hello, I'm new and I need to know how to make a new project I know how to make new one but it say "Project creation is currently disabled Our engineers are currently working on a fix. You can follow updates on https://status.supabase.com/" Can some one help me?
    n
    v
    g
    • 4
    • 9
  • v

    vikstack

    06/17/2022, 5:25 PM
    https://my_supabase_url/storage/v1/object/public/public-bucket/public/bbWh0lmuRQlzS64.mp4
    - this is the link given by supabase, its called publicUrl, idk why but when I open it, it does a 404 page 😦
    n
    h
    g
    • 4
    • 12
  • t

    tg44

    06/17/2022, 5:36 PM
    hy! I used prisma migrations, and reached the point when RLS works again, but realtime isn't working even if I disable rls for the tables. Any idea what roles/triggers/etc could be messed up?
    n
    g
    • 3
    • 28
  • b

    bhaskar

    06/17/2022, 7:10 PM
    Hi, i am not able to create new project due to an ongoing issue. do we have an ETA.
    n
    o
    • 3
    • 5
1...286287288...316Latest