https://supabase.com/ logo
Join Discord
Powered by
# help-and-questions
  • Is there a way to grab a users profile from a getSession request?
    v

    Vik

    01/08/2023, 1:27 AM
    Hi, there. When my application first loads I use the
    getSession
    method to handle navigation. Since my profiles table has a foreign key of ID that references the auth.users table, is it possible to also grab the user profile in the initial getSession request?
    g
    • 2
    • 1
  • I always get an error in Supabase when adding or deleting tables and columns in
    y

    yayza_

    01/08/2023, 2:06 AM
    I always get this failed to delete or failed to fetch error since I signed up yesterday.
    • 1
    • 4
  • .like() returns 'operator does not exist ~~ unknown`
    b

    Blobby

    01/08/2023, 4:06 AM
    Copy code
    const { data, error } = await sb_client.from(DB.ORDERS).select().like("uuid", "1ffdbd37%");
    Copy code
    supabase fetch orders error: {
      code: '42883',
      details: null,
      hint: 'No operator matches the given name and argument types. You might need to add explicit type casts.',
      message: 'operator does not exist: uuid ~~ unknown'
    }
    couldn't find root cause. potentially a bug?
    g
    u
    • 3
    • 8
  • Edge Functions - Import from files outside functions directory
    c

    cohlar

    01/08/2023, 4:52 AM
    Hi there, I'd like to know if there is a way to import local resources to edge functions from outside the
    supabase/functions
    directory. Specifically, I have a
    models
    root directory with TypeScript types and classes that I'd like to share across my frontend and my functions. I have tried a relative import, but get a
    Module not found
    error.
    u
    • 2
    • 6
  • Do free projects have daily downtime?
    h

    Horizon

    01/08/2023, 7:13 AM
    I've been finding that one of my free project that I use as staging server seems to always go down around this time with 520 and 522 errors (3:50pm ~ 4:10PM JST). While my other free project is working fine. I'm wondering if this is a known thing or if I'm hitting some kind of daily limit for a free tier project?
    g
    • 2
    • 1
  • relation pgsodium.decrypted_key does not exist
    s

    shihab94

    01/08/2023, 9:36 AM
    I am trying to run the
    supabase db reset
    but I am getting this error
    relation pgsodium.decrypted_key does not exist
    I've checked the db and I can see that the
    pgsodium
    extension is installed. What I did to solve this issue temporarily is commenting the lines that cause this error in the migration file:
    Copy code
    --
    -- Name: TABLE "decrypted_key"; Type: ACL; Schema: pgsodium; Owner: supabase_admin
    --
    
    -- GRANT ALL ON TABLE "pgsodium"."decrypted_key" TO "pgsodium_keyholder";
    
    
    --
    -- Name: TABLE "masking_rule"; Type: ACL; Schema: pgsodium; Owner: supabase_admin
    --
    
    -- GRANT ALL ON TABLE "pgsodium"."masking_rule" TO "pgsodium_keyholder";
    
    
    --
    -- Name: TABLE "mask_columns"; Type: ACL; Schema: pgsodium; Owner: supabase_admin
    --
    
    -- GRANT ALL ON TABLE "pgsodium"."mask_columns" TO "pgsodium_keyholder";
    I am not sure if these lines are very important and I want to know there is a way to resolve this issue.
  • `client.auth.getSession` return null session right after `client.auth.setSession`
    m

    manojVivek

    01/08/2023, 10:57 AM
    Hi, I'm facing an issue adding supabase authentication to an electron app after logging in on the browser. After a successful login on the browser I'm passing the
    session
    data to the electron app and calling
    client.auth.setSession(access_token, refresh_token)
    which successfully return the user info. But any subsequent call to
    client.auth.getSession()
    returns the session as
    null
    . Any idea what am I doing wrong that the session passed through
    setSession
    is not getting persisted in the supabase client instance. Here is the code in case that helps:
    Copy code
    supabase.auth
      .setSession({
        access_token: session.access_token,
        refresh_token: session.refresh_token,
      }).then(sessionData => {
    console.log(sessionData); // has valid data.
    console.log(supabase.auth.getSession()); // prints null session.
    };
    Appreciate any ideas on this.
    c
    g
    • 3
    • 5
  • Is it possible to host Supabase Pro in Hong Kong?
    t

    Temzin

    01/08/2023, 10:59 AM
    for now I chose Singapore but the ping is too high
    g
    • 2
    • 4
  • Can't downgrade project
    b

    bengra

    01/08/2023, 11:40 AM
    Im trying for 1 week to downgrade my project but the "confirm" button is forever loading
    g
    • 2
    • 1
  • How to manage users?
    m

    Marius.Dmn

    01/08/2023, 12:44 PM
    Hello! I'm learning DB and I'm not sure how to manage the users. So basically each user have an id and it represent and object like: { name: example, location: example, } And a lot of other informations that are related to the user. What's the best practice? To make a table for each user? Or in a table, a user represents a row? Can I store objects in supabase?
    u
    • 2
    • 2
  • Recovering deleted table data
    s

    Sarcodo

    01/08/2023, 1:28 PM
    Hi, I just deleted some records from my table, which should've been also stored in another table as I'm setting up a new history table however they aren't there. Is there a way to recover deleted data from a table?
    g
    • 2
    • 1
  • Realtime websockets not working with default docker setup (Auth error)
    c

    Cenezo

    01/08/2023, 1:49 PM
    Not sure what is going on. Does anyone know what the problem is? This is an out-of-the-box setup, nothing is changed.
    Copy code
    supabase-kong                   | 172.23.0.1 - - [08/Jan/2023:13:43:49 +0000] "GET /websocket?apikey=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyAgCiAgICAicm9sZSI6ICJhbm9uIiwKICAgICJpc3MiOiAic3VwYWJhc2UtZGVtbyIsCiAgICAiaWF0IjogMTY0MTc2OTIwMCwKICAgICJleHAiOiAxNzk5NTM1NjAwCn0.dc_X5iR_VP_qT0zsiyj_I_OZ2T9FtRU2BBNWN8Bu4GE&eventsPerSecond=10&vsn=1.0.0 HTTP/1.1" 404 48 "-" "-"
    realtime-dev.supabase-realtime  | 13:43:50.218 project=realtime-dev external_id=realtime-dev [error] Auth error: {:error, :signature_error}
    supabase-kong                   | 172.23.0.1 - - [08/Jan/2023:13:43:50 +0000] "GET /realtime/v1/websocket?apikey=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyAgCiAgICAicm9sZSI6ICJhbm9uIiwKICAgICJpc3MiOiAic3VwYWJhc2UtZGVtbyIsCiAgICAiaWF0IjogMTY0MTc2OTIwMCwKICAgICJleHAiOiAxNzk5NTM1NjAwCn0.dc_X5iR_VP_qT0zsiyj_I_OZ2T9FtRU2BBNWN8Bu4GE&vsn=1.0.0 HTTP/1.1" 403 0 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/108.0.0.0 Safari/537.36"
    g
    c
    +2
    • 5
    • 8
  • Trying to simply GET data from Database
    b

    bob_the_robot

    01/08/2023, 1:59 PM
    Here is a very cut-and-dry version of what I am working on https://codesandbox.io/p/sandbox/zealous-artem-zbpssq?file=%2Fpages%2Findex.tsx&selection=%5B%7B%22endColumn%22%3A26%2C%22endLineNumber%22%3A21%2C%22startColumn%22%3A26%2C%22startLineNumber%22%3A21%7D%5D All I am trying to do is get data from the database. The table is set to "RLS Enabled" and has a
    public
    Policy set to it. The table has 50 rows & 142 columns and I can view the data in the Supabase admin UI. Seems I am fundamentally missing something or there is a switch that I haven't toggled in the UI. Any help is appreciated.
    c
    • 2
    • 10
  • Supabase chopping off leading zeros when uploading a csv
    m

    millennialbets.eth

    01/08/2023, 3:55 PM
    Anyone have a work around? I tried adding quotes around the items, but that gives a lot of errors when querying the database.
    g
    • 2
    • 4
  • How to organize this model?
    o

    Olyno

    01/08/2023, 4:09 PM
    Hi I have some difficulties to see how organize this model in the database. Do you guys have some ideas on how do it? Should i use JSON type, or is there a better way?
    g
    • 2
    • 4
  • EMPTY vs NULL
    p

    pkdiscgolf

    01/08/2023, 4:54 PM
    I have a column "phonenumber" Initially it starts as NULL Then it stores a string in it when the user enters their phone# But, when I manually delete (from the supabase ui) a users phonenumber, the field turns to "EMPTY" instead of "NULL" How do i manually set the field to "NULL" rather then have it show "EMPTY" after a manual deletion
    g
    • 2
    • 17
  • Export Create Table statements
    r

    Rumen

    01/08/2023, 5:41 PM
    I've created and edit a few sql tables mainly though the supabase website and I want to reuse and share them. Is there an easy way to generate the CREATE TABLE statements that would allow me to create identically structured tables?
    g
    • 2
    • 2
  • Nest objects without json type
    j

    Jakob

    01/08/2023, 6:05 PM
    Is there any way to nest objects and other types without having to use the json type?
    g
    • 2
    • 2
  • Discord oauth - get new profile avatar after someone signed in
    p

    Peltos

    01/08/2023, 6:25 PM
    I'm currently working on a Vue app that requires users to login with Discord. I noticed that the Profile picture / Avatar of the discord user doesn't update after the user logged in. Is there a way to detect changes on the discord profile info so that the Avatar on my app matches the Avatar on their discord?
  • Is there a limit in the number of parallel edge function invocations?
    e

    eventually-consistent

    01/08/2023, 6:38 PM
    I am invoking about 100 edge functions by a cron but I see only 2 invocations in the dashboard. Did anyone run into same issue?
    t
    • 2
    • 3
  • Do edge functions have a execution time limit?
    y

    YourAverageTechBro

    01/08/2023, 7:23 PM
    Hey all. I'm looking into using edge functions to do some work, but I'm wondering if there are timeout limits? For example I saw Vercel's serverless functions have a timeout of 15sec, 60 sec, or 900 sec depending on the pricing plan and I was wondering if Supabase had anything similar? FWIW i'm on the pro plan.
  • TypeError: Cannot read properties of undefined (reading 'createClient') SvelteKit and Supabase
    c

    chickenmcnooble

    01/08/2023, 8:22 PM
    Hello, I am using Supabase on a project in conjunction with SvelteKit. I am following the example code from the docs pretty much verbatim.
    Copy code
    js
    import { createClient } from '@supabase/auth-helpers-sveltekit'
    
    import { PUBLIC_SUPABASE_URL, PUBLIC_SUPABASE_ANON_KEY } from '$env/static/public';
    
    export const supabaseClient = createClient(PUBLIC_SUPABASE_URL, PUBLIC_SUPABASE_ANON_KEY)
    However when i try to run the dev enviroment i get the following error
    Copy code
    TypeError: Cannot read properties of undefined (reading 'createClient')
        at /home/chicken/projects/qrdocentdashboard/src/lib/db.ts:5:30
        at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
        at async instantiateModule (file:///home/chicken/projects/qrdocentdashboard/node_modules/vite/dist/node/chunks/dep-5e7f419b.js:52224:9)
    I would really appreciate some guidance if anyone knows what the issue is. Thank you !
    • 1
    • 1
  • Function size is too large
    y

    YourAverageTechBro

    01/08/2023, 8:57 PM
    Hi everyone. I'm creating creating a Supabase function, but I'm running into the error of:
    "Error: Failed to update an existing Function's body on the Supabase project: {"message":"The function size exceeds the allowable limit"}"
    I think it is because I am trying to import the Facebook SDK — is there any best practice to reduce decrease function size?
    u
    t
    • 3
    • 4
  • 2FA for Dashboard
    h

    hyperknot

    01/08/2023, 9:24 PM
    Is it possible to set up 2FA for my Supabase account? I mean for the website / dashboard at https://app.supabase.com/
    g
    j
    • 3
    • 4
  • Importing types only on edge function
    d

    daniromo

    01/08/2023, 9:42 PM
    I'm trying to import only the types from the stripe library but they appear as unresolved when trying to import from a cdn. If I import from 'npm:stripe' the types correctly resolve but I can't deploy the function that way Does anyone know any workarounds?
  • Webhook Security
    y

    yairhaimo

    01/08/2023, 9:56 PM
    Whats the best practice on verifying that a Webhook was originated from Supabase and not just a random person on the internet? Supabase doesnt send specific headers (apiKey?) from what I saw. Thanks!
    g
    s
    b
    • 4
    • 5
  • [BEFORE TRIGGER] Getting the Data
    a

    anggoran

    01/09/2023, 12:42 AM
    Hello so I tried this function as a
    BEFORE DELETE TRIGGER
    on my
    public.documents
    . But when I tried with
    document_id = old.id
    or
    document_id = new.id
    , it didn't work, did I miss something? When I tried with hard coded id, it works though
    Copy code
    sql
    BEGIN
      DELETE FROM public.logbooks
      WHERE document_id = 27;
      RETURN new;
    END;
    g
    • 2
    • 2
  • Interacting - Troubleshooting Postgresql with docker (self-hosted)
    p

    pasha_dee

    01/09/2023, 4:46 AM
    Hey guys... been using self-hosted supabase for some testing, now all of a sudden after a bad shutdown some of the docker containers aren't able to connect to the postgresql container because "database is in recovery mode" ... I haven't been able to figure out with my limited docker knowledge on how I would login and interact with that container.. it seems neither sh nor bash is installed as in docker exec -it doesn't seem to find anything it can run.. not sure if there's some guide on what one can do in this case, would appreciate any pointers... thanks!
    s
    • 2
    • 1
  • Chained Query OR selector not working as expected
    s

    Sep

    01/09/2023, 5:03 AM
    I'd like to query a table using the supabase js library and retrieve all data that matches one or both of my query filters.
    Copy code
    const { data, errpr } = await supabase.from("connections").select().or("from.eq." + id, "to.eq." + id);
    This code returns data that matches the first filter I provide, "from.eq", not "to.eq". If I reversed, the filters, it would still filter by the first one provided. e.g.:
    Copy code
    const { data, errpr } = await supabase.from("connections").select().or("to.eq." + id, "from.eq." + id);
    How do I achieve this sort of filtering? I've attempted to chain filters like this using the library?
    g
    • 2
    • 1
  • Response email only in spam box
    s

    sinrabo

    01/09/2023, 5:19 AM
    Hi guys!. T using supabase.auth.signUp to register account but email only response in spam box (Gmail) even I installed MailerSend
    s
    • 2
    • 6
1...919293...230Latest