https://supabase.com/ logo
Join Discord
Powered by
# help-and-questions
  • Flutter Supabase query returns multiple instances
    o

    oski啦

    10/09/2022, 8:46 AM
    Hey guys, I'm having an issue where I am mapping a many to many relationship in the database between books and genres. However, when I filter this data, it'll return multiple instances of the same book if I query two genres that the book has. How do I stop this? Thanks!
    s
    g
    • 3
    • 6
  • Contributing to the Supabase Community organization
    f

    fenix

    10/09/2022, 11:12 AM
    @User Hi! I've tried contacting the administrators but didn't get any response. I wonder if it would be possible to contribute to the Supabase Community organization on Github, submitting my Supabase SDK for Godot Engine. Currently the SDK contains the features alltogether, but can be already separated in feature-repositories like it is already done in the Supabase Community org. Here's the SDK: https://github.com/fenix-hub/godot-engine.supabase The SDK is going to be updated following the most recent Supabase updates, and also a new version will be coming during the next month for Godot Engine 4.x, since the syntax is pretty much different.
    s
    c
    • 3
    • 17
  • Property 'signIn' does not exist on type 'SupabaseAuthClient'.
    u

    0xtouseef

    10/09/2022, 11:58 AM
    I am getting the following error
    Property 'signIn' does not exist on type 'SupabaseAuthClient'.
    for this code:
    Copy code
    export async function signInWithGoogle() {
      const { user, session, error } = await supabase.auth.signIn({
        provider: "google",
      });
    }
    j
    • 2
    • 3
  • Enable pg_cron in a migration
    p

    Profilüfter

    10/09/2022, 12:55 PM
    I'm currently trying to use the pg_cron extension. However when I try to enable it in a migration using
    CREATE EXTENSION pg_cron;
    I get the following error:
    Copy code
    Error: Error starting database: ERROR:  can only create extension in database postgres
    DETAIL:  Jobs must be scheduled from the database configured in cron.database_name, since the pg_cron background worker reads job de
    scriptions from this database.
    HINT:  Add cron.database_name = 'main' in postgresql.conf to use the current database.
    CONTEXT:  PL/pgSQL function inline_code_block line 4 at RAISE
    It's probably because the Supabase CLI creates a database named after the current branch (default
    main
    ) and only later renames it to
    postgres
    . Is there a way around this? If I try to enable the extension after I started the server it does work however I need to be able to use it in migrations.
    o
    • 2
    • 2
  • CLI - How do I use 'supabase link [flags]'?
    n

    niceplugin

    10/09/2022, 2:13 PM
    flags means Reference ID, right? If my Reference ID is ABCD, This is https://app.supabase.com/project/ABCD. So I entered the command 'supabase link --ABCD', It doesn't work. There is no guide on this. Existing guides are too short of explanation. No consideration for newbies at all. What should I do?
    o
    • 2
    • 1
  • Am I doing it all wrong?
    e

    edo

    10/09/2022, 2:53 PM
    I am building something that needs a server since it handles exchange of access and refresh tokens with Google and Microsoft. I decided to use Supabase for handling user signup / login to have one less thing to think about. But now I am faced with the following problems that makes me question whether I am using Supabase correctly and whether it fits my needs. The scenario I am facing is the following:
    Copy code
    A client logs in and then requests some information from the server. 
    The server retrieves the `access_token` for the user and gets the information
    The server sends the information back to the client
    A few questions: 1. How does the client makes an authenticated request to the server? From [this](https://github.com/supabase/supabase/discussions/1094) thread, my understanding is that I need to send a JWT to the server, and then the server needs to create a new Client (via
    supabase-js
    for example) and that will tell me which user is making the request. 2. Once I know the user that is making the request, I want to retrieve her tokens from the database. From my googling, it doesn't look like I can modify the table where the user information is stored
    auth.users
    , so what is the best way to go about this? Should I create a new table that contains the
    id
    of the user and the relative tokens? Do I do this from the web console of Supabase?
    g
    • 2
    • 6
  • Invalid input syntax for type bigint
    t

    Talajax

    10/09/2022, 3:14 PM
    Hi, i've just started using supabase with nextjs. I have i simple function that retrieve user data from 'profiles'
    Copy code
    let { data, error, status } = await supabase
              .from("profiles")
              .select(`username`)
              .eq("id", id)
              .single();
    
            if (error && status !== 406) {
              throw error;
            }
    
            if (data?.username) {
              router.push({ pathname: "/[account]", query: { account: id } });
              return;
            }
    At the [account].tsx page i'm receiving the id and making another query to 'profiles' to get user data, but this time i'm also getting the property avatar, which in my schema is defined as 'text'. But i'm receiving this error when i try to retrieve the avatar. The "4bc97434-c7a5-4a5e-a32d-e1c66a6a588e" is my user.id. After i uploaded the image to storage i retrieve it's url by getPublicUrl and updated the avatar property of the user. I don't understand what am i doing wrong here.
    g
    b
    • 3
    • 6
  • I have a website and a mobile app. How would you structure verification emails?
    l

    lewisd

    10/09/2022, 5:17 PM
    Hey guys, In my Supabase Auth settings I have
    localhost:3000
    as my site URL and my apps deeplink url has been added to the
    Redirect URLs
    list. When a user verifies their email, they're currently sent to
    localhost:3000/...
    I imagine ill change this to my website url when i go live. But im wondering how I would handle sending the user back to the mobile app instead of my website url, if they signed up from there?
    g
    g
    +3
    • 6
    • 9
  • Dotnet Core JWT Authority
    c

    ClumsyPenguin

    10/09/2022, 6:05 PM
    Hi, I am implementing the JWT token flow from SupaBase into my REST API written in DotNet 6 Historically you always needed a "Authority" (Issuer) field to pass into your configuration of the JWT authenticationScheme. However it seems that SupaBase do not pass it into their tokens. What is the default authority or issuer in SupaBase?
    g
    • 2
    • 8
  • doesn't supabasejs v1 support realtime broadcast function?
    t

    Thoth Trismegistus

    10/09/2022, 6:25 PM
    I can't find
    supabase.channels
    method
    g
    s
    • 3
    • 9
  • Authenticate user without JS
    u

    unpin

    10/09/2022, 6:30 PM
    Hello, I am trying to authenticate a user from a backend that is written in rust. Basically all what I need is to verify credentials and get user's uuid. How can I do this?
    o
    • 2
    • 2
  • Cant use Google OAUTH with supabase ,react native and typescript.
    w

    WaberHoruhe

    10/09/2022, 6:33 PM
    Ive followed both the apple implementation and the older one from #885237287280070708 and still cant make it work, im getting [Unhandled promise rejection: TypeError: undefined is not an object (evaluating 'window.location.href = url')]
    f
    • 2
    • 1
  • Supabase RLS accessing user's email.
    f

    floyare

    10/09/2022, 7:47 PM
    So I have a table with user profiles that contains basic user data like username, email, uid, etc. Now I have RLS enabled for this table to allow only user's profile to be edited. The thing is I want to get access to user's email from
    SELECT
    only if it's his profile. Anybody know how can I do that by RLS Policy?
    j
    o
    • 3
    • 5
  • Getting remote schema onto local supabase
    t

    TranquilMarmot

    10/09/2022, 10:55 PM
    I used the table editor on the supabase website to create a schema, and now I have supabase running locally. Is there a way to dump the remote schema onto my local database? I tried this after linking the project:
    Copy code
    supabase db remote changes
    But it just sits there with this message at 0% forever:
    Copy code
    Generating changes on the remote database since the last migration...
    I have no local schemas or migrations. There doesn't seem to be anything in the docs about doing this; the local development page (https://supabase.com/docs/guides/cli/local-development) only seems to have instructions for pushing changes from local -> remote
    • 1
    • 2
  • Many to many within the same table
    u

    매튜

    10/09/2022, 10:58 PM
    I have a vocabulary table and want to create many to many relationships between words like synonyms, antonyms, homophones, etc. Currently I have created a table called "antonyms" with an ID column, column A referencing one word, and column B referencing another word, however when I query this in supabase js I get an error "code: "42703", details: null, hint: null, message: "column vocabulary.antonyms does not exist" Does anyone have a working solution for many to many within the same table?
    g
    s
    • 3
    • 75
  • Optimistic UI tips with Supabase?
    u

    user8923

    10/10/2022, 12:18 AM
    What's the easiest way to create an optimistic UI with Supabase in React?
    s
    t
    j
    • 4
    • 4
  • how to build “link share” feature with RLS?
    v

    vjoohov

    10/10/2022, 1:31 AM
    I want to build link share feature. That is, the row can be read only if auth.uid()=row’s profile id or Row is read by shared link. How can i implement “Row is read by shared link” feature in RLS policy? Or is there any other way to implement this feature?
    g
    o
    • 3
    • 5
  • Storage REST API - Documentation
    c

    cbunge3

    10/10/2022, 4:35 AM
    I cannot find any documentation around the endpoints for storage and the entire API in general - any tips?
    o
    e
    • 3
    • 8
  • Many equals in query true
    s

    suroh

    10/10/2022, 8:44 AM
    Hello, I feel like I simply don't know the words to search for this solution so I am asking here. Apologies in advance if this is obvious! I'm trying to return results based on querying a join table. I have a recipe that joins an ingredients table and I want to write a query that can filter out the recipe based on the existence of multiple ingredients only (if both ingredients are not in the recipe, do not return it). My query (after following this -> https://github.com/supabase/supabase/discussions/6587) to get a result back if it has one ingredient by id looks like this :
    Copy code
    js
    let query = supabase
         .from('recipes')
         .select(
           '*, ingredients:recipe_ingredients(*, ingredient:ingredients(name)), qry:recipe_ingredients!inner(*, ingredient:ingredients(name))'
         )
         .eq('qry.ingredient_id', 1)
    For now my data structure of a single recipe looks something like this :
    Copy code
    js
    {
      "id": "17805382-150d-4dad-842a-15905f03c732",
      "name": "recipe name",
      "ingredients": [
        {
          "recipe_id": "17805382-150d-4dad-842a-15905f03c732",
          "ingredient_id": 1,
          "quantity": 6,
        },
        {
          "recipe_id": "17805382-150d-4dad-842a-15905f03c732",
          "ingredient_id": 10,
          "quantity": 5,
        }
      ]
    }
    I tried combining queries from an array in a for loop, but this doesn't return any results when more than one item query is added :
    Copy code
    js
    let query = supabase
        .from('recipes')
        .select(
           '*, ingredients:recipe_ingredients(*, ingredient:ingredients(name)), qry:recipe_ingredients!inner(*, ingredient:ingredients(name))'
        )
    
    for (let f of filter) {
        query = query.eq('qry.ingredient_id', f)
    }
    
    const { data, error } = await query
    Any assistance would be most welcome. 😖
  • How should i display user photo?
    t

    Talajax

    10/10/2022, 11:12 AM
    Hi, just started using Supabase. When the user uploads a photo, i retrieve it's public URL and add that to the avatar_url property of 'profiles' table row. And then at the account page i display it using that url as the img source. But i'm getting a GET 400 error. Am i doing it the wrong way? Should i create an object url like ?
    Copy code
    const { data, error } = await supabase.storage
            .from('avatars')
            .download(path)
          if (error) {
            throw error
          }
          const url = URL.createObjectURL(data)
    g
    h
    • 3
    • 23
  • Is there anyway to invoke an Edge function without Authorization Header?
    u

    49Ryann

    10/10/2022, 12:49 PM
    I'm currently using Twilio's Conversations API, where they allow a webhook to react to different things happening. I'd love to send some hooks back over to my Edge Functions to handle them but it seems I cannot Invoke them without any Auth header. Twilio doesn't seem to give me that option to add headers. Would Supabase recognise Auth params? in the url?
    g
    • 2
    • 2
  • how to update a user profile photo, this from the docs isn't clear enough and doesn't work either!
    h

    Hussein Kizz

    10/10/2022, 3:05 PM
    Hi, am trying to update the user avatar photo but am stuck and what the doc says is not working, it returns a response that says "resource not found" maybe there's something wrong with the file path to be modified but don't know how to correct that other than what is given in docs.
    g
    • 2
    • 53
  • how can i configure cli (local) for an already hosted project?
    t

    Thoth Trismegistus

    10/10/2022, 3:21 PM
    is it possible to configure cli (local development) for an already hosted project?
    s
    • 2
    • 2
  • is there a way to generate types for hosted db?
    t

    Thoth Trismegistus

    10/10/2022, 3:57 PM
    is there a way to generate types for hosted db?
    g
    • 2
    • 4
  • Supabase self hosted won't connect to local postgres
    j

    Jolt

    10/10/2022, 4:10 PM
    I've been attempting to put supabase on my server self hosted, everything works fine (including when the db and supabase aren't decoupled), but when I decouple them and use the locally hosted postgresql, it won't connect. I can connect through dbeaver fine, I tried with installing postgresql myself, and then deleted postgresql and the supabase folder. I reinstalled supabase from scratch, as well as installing https://github.com/supabase/postgres instead for the postgresql. However still no luck...
    Copy code
    10/Oct/2022:16:03:13 +0000: {"details":"connection to server at \"0.0.0.0\", port 5432 failed: Connection refused\n\tIs the server running on that host and accepting TCP/IP connections?\n","code":"","message":"Database connection error. Retrying the connection."}
    Copy code
    time="2022-10-10T16:03:15Z" level=fatal msg="running db migrations: Migrator: problem creating schema migrations: couldn't start a new transaction: could not create new transaction: failed to connect to `host=0.0.0.0 user=postgres database=postgres`: dial error (dial tcp 0.0.0.0:5432: connect: connection refused)"
    I've tried different host names and ports. Eg.
    localhost
    ,
    0.0.0.0
    ,
    127.0.0.1
    , and
    54322
    , but to no avail. On the previous install of postgres I created a new superuser with password etc. to see if it was a problem with that, but it wasn't, as well as creating a new database (editing env etc.) Anyone have any ideas?
    p
    • 2
    • 10
  • Can I use Amazon s3 for storage? I don't want to storage provided by supabase out of the box
    n

    nitinmurali

    10/10/2022, 4:12 PM
    I already have an account on s3
    g
    • 2
    • 1
  • Allow access to INSERT with RLS when user have specific value in profile's row.
    f

    floyare

    10/10/2022, 4:15 PM
    So I have table with user profiles and I want to restrict some features only to specific users with specific int value
    role
    if role is
    1
    INSERT
    request will be allowed. Anybody knows how can I do that with policies?
    c
    s
    g
    • 4
    • 23
  • Logging in with Google OAuth, can't redirect to any page besides home
    a

    anderjaska

    10/10/2022, 5:44 PM
    Is there some setting for this? I keep getting an SSL error. Is this on google OAuth or supabase? Thanks 🙂
    • 1
    • 1
  • Change Identify Type Column from starting from 1
    c

    cbunge3

    10/10/2022, 6:19 PM
    Is there a way to change a id column that has an identify type that increments each time a new row is inserted. For example if its a prior table with 50,000 rows can i have it start at 50,000 and increment to 50,001 on the next insert? Is there a sql query i could write for this or a way in the GUI to fix this?
    j
    g
    • 3
    • 7
  • How do I configure redirection for a password reset page
    j

    Joseph

    10/10/2022, 7:44 PM
    I have a web app using Vue 3 with custom account management pages: email verification page and password reset page. The problem is this: 1) User creates account / requests password reset email 2) User clicks email link to go to custom account management page 3) User is redirected to account management page for a split second 4) User is authenticated immediately thereafter and therefore redirected to a page requiring authentication With this setup, the user is unable to reset their password, and I'm unable to use the custom pages. Important notes: - I'm using redirectTo inside the "resetPasswordForEmail" method, and I'm using it correctly. - I have the proper localhost URL inside the Supabase auth dashboard - I'm using Vue router and doing all routing inside App.vue Please help me resolve this
    s
    b
    +3
    • 6
    • 23
1...414243...230Latest