https://supabase.com/ logo
Join Discord
Powered by
# help-and-questions
  • How do you connect S3 Storage/Spaces to Supabase?
    a

    AntDX316

    01/25/2023, 12:29 AM
    How do you connect S3 Storage/Spaces to Supabase?
    g
    • 2
    • 2
  • How to manually set session cookie without standard auth login methods?
    j

    jinsley8

    01/25/2023, 1:24 AM
    Is there a correct way to set the session cookie without using the standard Auth login methods (Email, Magic Link, Phone, Social)? I saw the v2 changes here but it's a bit confusing: https://supabase.com/docs/reference/javascript/v1/upgrade-guide#cookie-methods Can Auth helpers packages be used without Auth Login? https://supabase.com/docs/guides/auth/auth-helpers/nextjs#server-side-rendering-ssr Any demos showing how to use this basic SSR in Next.js? https://supabase.com/docs/guides/auth/server-side-rendering
    j
    • 2
    • 4
  • Using extensions in function/trigger
    r

    rajamaka

    01/25/2023, 4:46 AM
    I am trying to run a function that is executed on new user creation events. When I am trying to use uuid.generate_v4() in the function, I get "function uuid.generate_v4() does not exist". I also tried using extensions.uuid.generate_v4() and I get a permissions denied for schema extensions. Apologies if a really dumb question... New to SQL/Supabase Here is the function: begin insert into public.api_keys (id, created_at, updated_at, api_key, owner) values (uuid_generate_v4(), now(), now(), uuid_generate_v4(), new.id); return new; end;
    s
    • 2
    • 4
  • Using an Encrypted Table in react app
    e

    Ebubekir YÜCEL

    01/25/2023, 6:12 AM
    How can I get data encrypted with podium with JS from database. I tried but failed.
    Copy code
    json
    {
      error: {
        code: '42501',
        details: null,
        hint: null,
        message: 'permission denied for function crypto_aead_det_decrypt'
      },
      data: null,
      count: null,
      status: 401,
      statusText: 'Unauthorized'
    }
  • Session is null with Supabase Auth
    t

    tererun / てれるん

    01/25/2023, 7:42 AM
    I'm trying to use Auth Helper to implement Supabase Auth in Next.js. I followed the official documentation but Session is still null. Oddly enough, after a few login attempts, sometimes Session isn't null. When Session is null, the event of onAuthStateChange isn't called and there is no Cookie in browser. here is my code:  https://github.com/tererun/supabase-auth-test thanks
    • 1
    • 1
  • Access code to signunp
    u

    _Zaizen_

    01/25/2023, 7:52 AM
    Hey everyone, I'm trying to do a signup page where you can only signup if you have a certain access code. the users gets registered to the default supabase users while the access code is store in a table called "codes" that looks something like this: primary key: id code: text (the code) Obviously I don't want the codes table to be public to anon users. The issue I'm having is with the function to trigger before the query to signup the users. I can't figure out how to get supabase to process the access code used by the user. Any tips on how should I approach this? thanks
    s
    j
    g
    • 4
    • 41
  • Overwrite local schema?
    a

    Amr

    01/25/2023, 7:55 AM
    I started my project in the cloud, then I wanted to shift development to my local machine and push changes to staging, then to production like a sane person. So I setup the supabase cli, and used
    supabase remote commit
    then
    supabase db reset
    , it copied the schema from the cloud , but I also wanted the data there, so I used
    pg_dump -d 'postgresql://postgres:xxx@db.xxx.supabase.co:5432/postgres' --no-comments -v >  dump.sql
    then created a new migration with
    supabase migration new dump < dump.sql
    , but after running `supabase db reset`: I find this error:
    Copy code
    Resetting database...
    Initialising schema...
    Applying migration 20230125074447_dump.sql...
    Error: ERROR: schema "auth" already exists (SQLSTATE 42P06)
    At statement 10: --
    -- TOC entry 23 (class 2615 OID 26604)
    -- Name: auth; Type: SCHEMA; Schema: -; Owner: supabase_admin
    --
    CREATE SCHEMA auth
    Try rerunning the command with --debug to troubleshoot the error.
    I'm aware of the
    -N
    argument in
    pg_dump
    that excludes a schema according to the given pattern, I don't want that because I want to clone everything from the cloud database including users?
    s
    • 2
    • 4
  • Auth not working on IOS
    n

    Niki2k1

    01/25/2023, 8:43 AM
    I am using the Nuxt Library, when trying to login I just get redirected to the login page again. It seems like the cookie doesn't set. My Code looks similar to the one from the Demo. Chrome on Windows works fine When trying to login to the Demo everything seems to look fine. The app is deployed behind an traefik reverse proxy
  • Deno Braintree Payment Integration
    s

    singgih

    01/25/2023, 9:40 AM
    I'm having trouble integrating Braintree payments using Deno. When I try to create a transaction with a payment method and create a customer. I get an error from the log like this.
    Copy code
    TypeError: B.setTimeout is not a function
        at https://esm.sh/v104/braintree@3.13.0/X-ZHN2LzAuMTMyLjA/deno/braintree.js:2:11960
        at new Promise (<anonymous>)
        at Je.httpRequest (https://esm.sh/v104/braintree@3.13.0/X-ZHN2LzAuMTMyLjA/deno/braintree.js:2:11184)
        at Je.<anonymous> (https://esm.sh/v104/@braintree/wrap-promise@2.1.0/X-ZHN2LzAuMTMyLjA/deno/wrap-promise.js:2:1479)
        at Je.post (https://esm.sh/v104/braintree@3.13.0/X-ZHN2LzAuMTMyLjA/deno/braintree.js:2:10463)
        at Je.<anonymous> (https://esm.sh/v104/@braintree/wrap-promise@2.1.0/X-ZHN2LzAuMTMyLjA/deno/wrap-promise.js:2:1479)
        at Ur.create (https://esm.sh/v104/braintree@3.13.0/X-ZHN2LzAuMTMyLjA/deno/braintree.js:22:19972)
        at Ur.<anonymous> (https://esm.sh/v104/@braintree/wrap-promise@2.1.0/X-ZHN2LzAuMTMyLjA/deno/wrap-promise.js:2:1479)
        at Ur.sale (https://esm.sh/v104/braintree@3.13.0/X-ZHN2LzAuMTMyLjA/deno/braintree.js:22:20894)
        at Ur.<anonymous> (https://esm.sh/v104/@braintree/wrap-promise@2.1.0/X-ZHN2LzAuMTMyLjA/deno/wrap-promise.js:2:1479)
    and here it's my source code
    Copy code
    import braintree from "https://esm.sh/braintree@3.13.0?target=deno&no-check";
    
    export const gateway = new braintree.BraintreeGateway({
      environment: braintree.Environment.Sandbox,
      merchantId: Deno.env.get("BRAINTREE_MERCHANT_ID") ?? "",
      publicKey: Deno.env.get("BRAINTREE_PUBLIC_KEY") ?? "",
      privateKey: Deno.env.get("BRAINTREE_PRIVATE_KEY") ?? "",
    });
    Copy code
    const result = await gateway.transaction.sale({
            amount: "10",
            customer: {
              id: user.id,
              email: user.email ?? "",
            },
            paymentMethodNonce: nonce,
            deviceData: deviceData,
          });
  • prepared statement "s1" does not exist, vague error
    g

    Glop

    01/25/2023, 9:59 AM
    Every time my program deploys it always fails due to an unexpected statement with this vague error. It fails on prisma db push, didn't used to. I have pgbouncer in connection string and have restarted db multiple times. Any help is appreciated
    Copy code
    #13 8.185    0: sql_migration_connector::flavour::postgres::connection::describe_schema
    #13 8.185            with namespaces=None
    #13 8.185              at migration-engine/connectors/sql-migration-connector/src/flavour/postgres/connection.rs:31
    #13 8.185    1: migration_core::state::SchemaPush
    #13 8.185              at migration-engine/core/src/state.rs:381
    n
    • 2
    • 11
  • Supabase and Hasura problem.
    a

    AntDX316

    01/25/2023, 10:37 AM
    I've added a new column on Supabase so I did a reload on Hasura to see it. Well it sees it and the query works but when using REST it says: {"code":"validation-failed","error":"field 'result' not found in type: 'table1'","path":"$.selectionSet.table1.selectionSet.result"} I think the only way is to delete the schema and retrack? There should be a better way next time?
    s
    • 2
    • 4
  • sequence in a function
    d

    delight

    01/25/2023, 10:57 AM
    is it possible to create a sequence in a function? I tried something like:
    Copy code
    sql
    -- drop function c_sequence;
    
    create or replace function c_sequence(sequenceName_input text)
    returns text
    language plpgsql 
    as $$  
    BEGIN
      CREATE SEQUENCE sequenceName_input;
      return sequenceName_input || ' created';
    END;
    $$;
    but it won't pick up the value of sequenceName_input. Instead it uses it as a literal string and creates a sequence Named 'sequenceName_input'
    g
    • 2
    • 3
  • How do you fix new public schema/table permissions from Supabase??
    a

    AntDX316

    01/25/2023, 11:04 AM
    How do you fix new public schema/table permissions from Supabase?? I've had to delete the scheme folder entirely then recreate in Supabase but I can't figure out how to get permissions back. I need it to be in Supabase because it does a created_at timestamp.
    s
    • 2
    • 18
  • Getting empty array while fetching bucketList
    i

    Imposer

    01/25/2023, 11:07 AM
    I have created a bucket with the name video and when i try to fetch all the buckets, i am getting empty bucketList. I also have the user logged in. I have added policy for selecting, updating and deleting. Please help me fetch the buckets. Thanks
    • 1
    • 2
  • pgbouncer SSL
    j

    jg247

    01/25/2023, 12:54 PM
    Hi, it seems like SSL connections are not possible when using pg bouncer? I'm getting this when trying to connect through pgbouncer (i.e. port 6543)
    psql: error: server does not support SSL, but SSL was required
    Looking at https://github.com/supabase/postgres/blob/develop/ansible/files/pgbouncer_config/pgbouncer.ini.j2 it looks like ssl is disabled
    • 1
    • 1
  • Pass text[] in metadata at signUp
    m

    Maxx

    01/25/2023, 12:58 PM
    Hello, I try to pass a List to the SignUp-method's metadata (along with some other values like firstname,...). Without the List of Strings, it worked as expected, but now it throws this error: > "ERROR: column "liked_list" is of type text[] but expression is of type text (SQLSTATE 42804)" The column "liked_list" exists as text[] in the appropriate table.
    g
    • 2
    • 3
  • Pause and restore project doesn't update to Postgrest 11
    j

    jaypinho

    01/25/2023, 2:19 PM
    I attempted to upgrade to Postgrest 11 by pausing and then restoring my Supabase project (as directed by Supabase via email), but when I run
    Copy code
    select version()
    in query editor, I'm still seeing:
    Copy code
    PostgreSQL 15.1 on aarch64-unknown-linux-gnu, compiled by gcc (Ubuntu 10.3.0-1ubuntu1~20.04) 10.3.0, 64-bit
    And I'm also unable to order by fields in a foreign table, as is supposed to work per here: https://supabase.com/blog/postgrest-11-prerelease#order-by-related-tables. Is there a way to force it to update?
    g
    s
    s
    • 4
    • 14
  • What if the id of a row exceeds the limit?
    u

    ! Do you even Vim, bro?

    01/25/2023, 4:25 PM
    I am developing a chat application and have a
    message
    table. Each
    message
    row has an
    id
    column set as
    int8
    type. I am concerned that if the number of messages exceeds the limit for that data type, what will happen?
    g
    • 2
    • 5
  • missing features on db tables
    s

    streamerd

    01/25/2023, 6:42 PM
    Hello everyone, as of today, when creating a new table, I cannot seem to find varchar as data type and also cannot find user table as part of displayed options when I want to refer to that table as foreign key. Any idea what'd be the reason for that? It is like this since a couple of hours now. // it's not a realtime-centric question per se, all mentioned tables above are real-time enabled. fyi.
    g
    • 2
    • 9
  • Is it possible to restrict access to a realtime channel to the service role?
    d

    dextah

    01/25/2023, 6:50 PM
    Is it possible to restrict access to a realtime channel to the service role? Are all non-db channels public?
    g
    • 2
    • 1
  • OAuth sign in creates duplicated cookies
    i

    iinanc

    01/25/2023, 6:54 PM
    Hello, as described in the title, I'm using Google OAuth sign in. After signed in browser shows duplicated cookies both of localhost and superbase. Is there a way to prevent this behaviour?
    s
    • 2
    • 1
  • Auth session without signing in
    u

    ! Do you even Vim, bro?

    01/25/2023, 7:02 PM
    How can I create and manage a session without requiring users to sign in to the app? Similar to the functionality on the website https://w2g.tv/en/, where users can create a virtual room with chat without having to register. Can this be achieved using Supabase Auth?
  • Use of `channel.track()` for Prescence?
    h

    harshcut

    01/25/2023, 7:09 PM
    I read the docs for realtime and couldn't clearly understand the use of
    channel.track
    function. > Each client can use the channel's track method to store an object in shared state. > > https://supabase.com/docs/guides/realtime/quickstart#track-and-display-which-users-are-online What type of data should be passed to it?
  • TypeScript and Supabase
    u

    ! Do you even Vim, bro?

    01/25/2023, 7:36 PM
    If I generically pass
    Database
    type as stated here: https://supabase.com/docs/reference/javascript/select, should I get any IntelliSense when calling methods like
    from
    or
    insert
    or whatever at this point?
    s
    c
    • 3
    • 32
  • How can i change auth email template on docker selfhosted
    f

    Frah🔥

    01/25/2023, 7:37 PM
    I want to change email template, i tried for several hours but i didn't find a way, is there a way to do this?
    g
    • 2
    • 8
  • How much can this thing scale
    n

    nickbryant.fyi

    01/25/2023, 7:48 PM
    I'm new to supabase and a little too busy prototyping to do much research. Sounds like this project is postgres under the hood with an API layer between? Does that mean the scalability properties are similar to a single instance postgres? I.e. no horizontal scaling abilities. I like the product but I want to make sure it's ready for handling 1b records. Either that or I'll use NoSQL for the big stuff I suppose. Insight appreciated here.
    g
    • 2
    • 1
  • Help understand Supabase auth with Sveltekit auth-helpers
    t

    Trixrabbit

    01/25/2023, 9:07 PM
    I'm currently going through the documentation on how to setup auth with the sveltekit-auth-helper function and although everything is working fine, I'm having a hard time wrapping my head around how things work. For example, the docs mention that to do data fetching using RLS client-side, we need to import
    $lib/db
    in our component, but we need to use the auth-helper
    getSupabase
    when doing data fetching on the server. Why is that ? If my server load function passes the session + supabaseClient down to the client, isn't that already enough ? I read and re-read the documentation : https://supabase.com/docs/guides/auth/auth-helpers/sveltekit and https://supabase.com/docs/guides/getting-started/tutorials/with-sveltekit multiple times and also read the auth-helper function code and I just don't quite get it (yet). Another example is why the docs mention calling
    getServerSession(event)
    in the layout.server.ts and
    getSupabase(event)
    in the layout.ts to get the session, why call 2 different functions ? From Sveltekit docs, the client would have the session coming from the data of the server load function Maybe I'm missing something obvious here, I tried to test if this structure was to make sure we invalidate properly, but couldn't really find any answers. This is my first app with supabase auth and I am trying to understand better.
  • Using signed URL to upload a file results in "resource was not found" error
    k

    Kurdiez

    01/25/2023, 9:09 PM
    I have this code that is supposed to generate the signed URL.
    Copy code
    ts
    const fileName = 'whatever.jpg';
    const signedUrl = await this.supabase.storage.from("images").createSignedUrl(fileName, 60);
    When I run this I get the error
    StorageApiError: The resource was not found
    . Why would it complain about resource not being found when I am trying to generate the signed URL to put the resource at that location? Of course it doesn't exist yet since I haven't done
    HTTP PUT
    to the signed URL to upload the resource.
    g
    • 2
    • 10
  • @supabase/postgrest-js Rollbacks
    a

    atticoos

    01/25/2023, 10:27 PM
    TLDR: How does
    PostgresTransformBuilder.rollback()
    work? ~~ Was reading through the
    PostgrestTransformBuilder
    API and discovered it has a
    rollback()
    method https://github.com/supabase/postgrest-js/blob/933b4d622ac1ef12b7cb19a8c163a4db4a8721d4/src/PostgrestTransformBuilder.ts#L230-L242 Jumped over to the tests, and sure enough it looks like it'll rollback a mutation https://github.com/supabase/postgrest-js/blob/94db7098ef9d75766b8ca84b1e888f34a3eb759d/test/transforms.ts#L217-L271 But when I gave it a try, the record remained in the database and was not removed. I haven't come across documentation on this method, but I did come across it exposed on the
    SupabaseClient
    so it seems like it can be used -- but not sure how. Anyone with success story on this one?
    g
    • 2
    • 2
  • Supabase OAuth not logging user in
    c

    cassi

    01/25/2023, 11:37 PM
    When using Discord OAuth the user does not get logged in and nothing actually happens other than the user being created. When using an email and password login everything works correctly. There are no errors and when using
    useSessionContext
    and
    isLoading
    does update. I am using NextJS 13 (no app folder). I am following along with this guide https://supabase.com/docs/guides/auth/auth-helpers/nextjs
    f
    t
    +3
    • 6
    • 29
1...108109110...230Latest