https://supabase.com/ logo
Join Discord
Powered by
# help-and-questions
  • Allow email logins but not signup
    b

    Bloxs

    05/09/2023, 11:42 PM
    I'm trying to create a demo user to view my site and I'm doing it using supabase's email login but I can't log into the account unless email login & signup is enabled but I'd like to only allow signing up with an external account (ie google). Is there any way I can do this?
  • Transferring users from auth0 to supabase auth without their hashed password.
    n

    nicollegah

    05/10/2023, 12:37 AM
    Hey, I have several thousand users in a database in auth0 and would like to migrate them to supabase. I can export them as CSV but only without their hashed passwords. They used both Google social sign in as well as "normal" email sign in. What's the easiest and least disruptive way to do this? Thanks 🙏
    g
    • 2
    • 2
  • Error 406 When Accessing PostgreSQL Database After Deleting Row from lead_events Table on Supabase
    m

    matthieup

    05/10/2023, 4:24 AM
    Hi, I am currently experiencing an issue with deleting a row from the lead_events table in my PostgreSQL database hosted on Supabase. After deleting a row from the lead_events table, I noticed that the corresponding row in the leads table is not being deleted. However, when I try to access this data from my React Admin application, I receive a 406 error. I have confirmed that the deletion of the row from lead_events is indeed being executed by directly connecting to the database via a graphical interface. Can you please help me resolve this issue? Could this be related to incorrect configuration of my Row-Level Security (RLS) policies? Thank you in advance for your help
    n
    g
    • 3
    • 3
  • Access TCE data best practice
    s

    StiffJobs

    05/10/2023, 4:43 AM
    Is using the rpc call to request the encrypted data from view the best practice to use the TCE?
    s
    • 2
    • 3
  • How to access cookie data?
    a

    Actual Left Shark

    05/10/2023, 4:57 AM
    using NextJS 13 with the App directory I followed the tutorial here https://supabase.com/docs/guides/auth/auth-helpers/nextjs-server-components and was wondering- how can I access the information about the user signed in and show something like "Hi, {signedInUserName}" and how can I access their UUID so that I can pull only blog posts created by them?
    n
    g
    • 3
    • 10
  • My users are not able to sign up. Login tokens are invalid or expired in 0 sec
    v

    vinciarts

    05/10/2023, 5:40 AM
    When sign up via one time password, the server returns the token is expired or is invalid. Only signups are affected, sign in is ok. The links are look like this https://fnrgumolvujsacccninh.supabase.co/auth/v1/verify?token=ac595ad57768b741d8bcd3f8681c668305eabeb2972199aa6826dc42&type=magiclink&redirect_to=**
    s
    • 2
    • 2
  • Changing smtp server on self-hosted
    m

    Martin Piliar

    05/10/2023, 6:02 AM
    Hey, I know that stuff like JWT_SECRET etc... needs cleaning the pgdata volume, but do I need to do the same with the smtp server credentials? Thank you
    t
    • 2
    • 3
  • Conditionally Upserting
    d

    DaJacy

    05/10/2023, 9:14 AM
    In case the row does not exist, I want to insert. In case the row does exist, I want to update IF the column 'local_timestamp' of the new data is greater than the existing one. This is what I tried, but the update even works if the 'local_timestamp' of the new data is smaller than the existing one:
    Copy code
    dart
    final res = await supabase
              .from('exercises')
              .upsert(data, onConflict: columnId)
              .match({'id': data['id']}).lt(
                  columnLocalTimestamp, data[columnLocalTimestamp]);
    I would appreciate help very much!
    g
    m
    • 3
    • 6
  • Organizing migration scripts
    i

    indymaat

    05/10/2023, 9:38 AM
    Is there a better way to organize your migration scripts? I come from a company that builds database applications and they had a structure where all database objects essentially had their own folders. let me give an example of the folder structure that i would like in order to improve readability and maintainability for larger projects.
    Copy code
    /new
    -/tables
    -/policies
    -/constraints
    --/primary keys
    --/foreign keys 
    --/check
    -/indexes
    -/...
    /latest
    -/triggers
    -/views
    -/functions
    -/...
    /drop
    -/tables
    -/constraints
    -/...
    and so on... Is there any way, or should all changes be done inside 1 migration script?
    s
    • 2
    • 3
  • Error P4002 using prisma
    n

    Nico

    05/10/2023, 9:54 AM
    First sorry for my bad english, I try my best. When I want to do a migration with the
    yarn rw migrate dev
    command (I'm using redwood), I keep getting error P4002 saying this : The schema of the introspected database was inconsistent: Cross schema references are only allowed when the target schema is listed in the schemas property of your datasource.
    public.create_info
    points to
    auth.users
    in constraint
    create_info_id_fkey
    . Please add
    auth
    to your
    schemas
    property and run this command again. I was following this tuto : https://redwoodjs.com/docs/tutorial/chapter4/deployment Do I need to add specific line in my schema.prisma ?
  • My token is not being accepted when i try to login to supabase with cli.
    b

    bilals

    05/10/2023, 9:58 AM
    > > npx supabase login > You can generate an access token from https://app.supabase.com/account/tokens > Enter your access token: sbp_v0_53b... Error: Invalid access token format. Must be like
    sbp_0102...1920
    . Try rerunning the command with --debug to troubleshoot the error. I have tried dding quotes to my token, i also generated a new token, but nothing seems to work. What am i doing wrong?
    s
    • 2
    • 4
  • web based application using supabse realtime
    y

    YashG

    05/10/2023, 11:04 AM
    Hello, I wish to develope a web based application, for using supabase , I have the following code, but its not working Supabase Real-time Chat Send var supabaseUrl = 'YOUR_SUPABASE_URL'; var supabaseAnonKey = 'YOUR_SUPABASE_ANON_KEY'; var supabase = supabase.createClient(supabaseUrl, supabaseAnonKey); var usernameInput = document.getElementById('username'); var newMessageInput = document.getElementById('newMessage'); var sendButton = document.getElementById('sendButton'); var messagesDiv = document.getElementById('messages'); async function sendMessage() { var username = usernameInput.value; var message = newMessageInput.value; if (!username || !message) return; await supabase .from('messages') .insert([ { username: username, message: message }, ]); newMessageInput.value = ''; } supabase .from('messages') .on('*', payload => { var newMessage = document.createElement('p'); newMessage.textContent = payload.new.username + ': ' + payload.new.message; messagesDiv.appendChild(newMessage); }) .subscribe(); sendButton.addEventListener('click', sendMessage);
    s
    • 2
    • 34
  • Caution: config.toml is sadly out of date
    v

    ven

    05/10/2023, 11:11 AM
    I have been trying to install Logflare following the instruction link in the config.toml (see attached image). They point to a logflare site with instructions on how to setup. After wasting two days in the google cloud sinkhole i finally filed a ticket. this is the response i got today
    Copy code
    Hi Ven,
    
    You should not need a Logflare account, only a Google Cloud account.
    
    Could you reference tne Analytics server self hosting docs here:
    
    https://supabase.com/docs/reference/self-hosting-analytics/introduction#getting-started
    
    
    Looks like the example config.toml is pointing to the Logflare docs by mistake, i'll get that fixed.
    I hope they fix that toml file and inform us so that we can update our local instances safely.

    https://cdn.discordapp.com/attachments/1105814365468364840/1105814365896196096/config.toml.png▾

    o
    • 2
    • 4
  • Issues in setting up Supabase Authentication in Local Hosted Instance
    s

    Saad

    05/10/2023, 11:34 AM
    Hi, I have been using Supabase for a month now, I have only used the cloud version since then and I am recently trying out the local hosted instance to develop an application on Tooljet. I tried following similar steps for setting up Auth like I did for the cloud version. However, I am stuck, currently I am not finding the: Site URL and Redirect URLs as well as JWT Token. (Can you tell me where to find these settings in the local instance) I am trying to use Auth to create a sign-up but the local instance is not working. I am sharing images of the API that is using Cloud and the one using local instance of Supabase. Looking forward to some pointers. I am not sure if I set up my local instance of Supabase wrongly.

    https://cdn.discordapp.com/attachments/1105820155684073553/1105820155843465357/local_instance.png▾

    https://cdn.discordapp.com/attachments/1105820155684073553/1105820156141248542/cloud_instance.png▾

    o
    g
    • 3
    • 9
  • pg_vector not enabled on my account?
    l

    lynq-paul

    05/10/2023, 11:39 AM
    I cannot view pg_vector extension in the Databases -> Extensions page to enable pg_vector, when I run CREATE extension vector, postgres returns an error
    g
    • 2
    • 1
  • Change Google "continue to" to my site
    n

    nateland

    05/10/2023, 11:52 AM
    Anyone ever use Google to sign in and change the url from their supabase url to their company URL? How can I do this?

    https://cdn.discordapp.com/attachments/1105824584609046659/1105824584990732318/Screenshot_2023-05-10_at_1.51.41_PM.png▾

    k
    g
    m
    • 4
    • 51
  • Migrate production locally
    k

    kresimirgalic

    05/10/2023, 12:17 PM
    Hello, is there a docs where i can read more about migration from production locally?
    s
    g
    m
    • 4
    • 6
  • Supabase CLI Edge Functions "t is not a function" axios
    s

    SunTzu

    05/10/2023, 1:27 PM
    Hey! I'm trying to use OpenAI with Edge Functions however end up getting this error:
    Copy code
    TypeError: t is not a function
        at Ke.exports (https://esm.sh/v120/axios@0.26.1/esnext/axios.mjs:3:5734)
        at T.request (https://esm.sh/v120/axios@0.26.1/esnext/axios.mjs:3:9122)
        at Function.request (https://esm.sh/v120/axios@0.26.1/esnext/axios.mjs:2:839)
        at https://esm.sh/v120/openai@3.2.1/esnext/openai.mjs:2:3794
        at https://esm.sh/v120/openai@3.2.1/esnext/openai.mjs:2:26914
        at async n._fn (https://esm.sh/v120/p-retry@4.6.2/esnext/p-retry.mjs:2:1577)
    any ideas? Supabase CLI Version: 1.57.4 Code tried to be used below:
    Copy code
    const chain = ConversationalRetrievalQAChain.fromLLM(
            model,
            supaStore.asRetriever(null, { chatbots: `%${body.bot}%` }),
            {
              qaTemplate: contextprompt,
              returnSourceDocuments: true,
            }
          );
          console.log("about to chain call");
          const res = await chain.call({
            question: body.user_message,
            chat_history: [],
          });
    s
    • 2
    • 3
  • Missing sub claim
    h

    Hexxadon

    05/10/2023, 1:51 PM
    When I try to log a user out (test account), after successfully signing up and subsequently producing a JWT, I get "missing sub claim" when I try to log them out using that same JWT. The user is able to successfully sign up, authenticate and sign in, but it still produces an invalid JWT according to jwt.io, despite the fact that it is able to successfully retrieve the user's uuid in the payload. Any ideas?
    g
    n
    • 3
    • 23
  • Logged out user / anon cant insert data
    p

    puffybatman

    05/10/2023, 1:54 PM
    I have simple table, where both logged in / out users can add data but this dont work....
    Copy code
    CREATE POLICY "allow everyone" ON "public"."tbl"
    AS PERMISSIVE FOR INSERT
    TO public
    
    WITH CHECK (true)
    About returns this error:
    WSError (CompactDecodeError Invalid number of parts: Expected 3 parts; got 2)
    g
    • 2
    • 10
  • Production Down
    j

    jdom93

    05/10/2023, 2:03 PM
    ✅ Hey Guys, our Supabase Production is not responding. Id is : kxjrjcvxdyehwmolbjib -- any news?
    u
    g
    f
    • 4
    • 16
  • How can I read data from an encrypted column?
    s

    supafloh

    05/10/2023, 2:38 PM
    I have 2 encrypted columns and a single key for both. I want the user to be able to read the decrypted values from their own row, is there a way to do this using the Javascript client library? Something like this for xample?
    Copy code
    js
    const [data, error] = await supabase
      .from('profiles')
      .select(decrypt('sensitive_info'))
      .eq('user', user.id)
    If not, is there a way to do this in the edge function where I'm sending the value after the client fetches it?
    v
    g
    • 3
    • 4
  • Edge functions unit test passes but with empty array. Thunderclient returns "Error: channel closed"
    v

    ven

    05/10/2023, 3:01 PM
    OS - Windows 11 cli - 1.57.4 I have the latest images downloaded today. What could be causing this?
    Copy code
    2023-05-10 09:30:51 serving the request with /home/deno/functions/contact
    2023-05-10 09:30:51 Error: channel closed
    2023-05-10 09:30:51     at async Function.create (ext:sb_user_workers/user_workers.js:75:21)
    2023-05-10 09:30:51     at async Server.<anonymous> (file:///home/deno/main/index.ts:94:24)
    2023-05-10 09:30:51     at async Server.#respond (https://deno.land/std@0.182.0/http/server.ts:220:24)
    and here is the contact me services class making the call
    Copy code
    const supabaseClient = createClient(
        Deno.env.get('SUPABASE_URL') ?? loadDotenv().SUP_SUPABASE_URL ?? '',
        Deno.env.get('SUPABASE_ANON_KEY') ??
            loadDotenv().SUP_SUPABASE_ANON_KEY ??
            ''
    );
    
    export class ContactMeService {
        async getAllContacts(): Promise<ContactMeRecord[]> {
            const { data, error } = await supabaseClient
                .from('contact_me')
                .select();
            console.log('contact me data');
            console.log(data);
    
            if (error) {
                throw new Error(`Failed to fetch contacts: ${error.message}`);
            }
    
            return data as unknown as ContactMeRecord[];
        }
    }

    https://cdn.discordapp.com/attachments/1105872124679295047/1105872124918386809/contact_me_table.png▾

    https://cdn.discordapp.com/attachments/1105872124679295047/1105872125316837427/unit_test_passes_but_with_empty.png▾

    s
    g
    g
    • 4
    • 27
  • Can supabase store audio files?
    k

    Kyborq

    05/10/2023, 3:24 PM
    Is it worth storing the music that users upload to the supabase storage, or is it better to use a separate service for this? and is it possible to increase the storage capacity, if so
    o
    • 2
    • 1
  • Edge Function module not found
    b

    bombillazo

    05/10/2023, 4:32 PM
    Hello, I am having problems using
    supabase functions serve
    command. I am getting the error:
    Copy code
    sh
    error: Module not found "file:///home/src/transform/item.transform.ts".
        at file:///home/deno/functions/my-function/index.ts:5:29
    I have this in my import map:
    Copy code
    json
    // import_map.json
    {
      "imports": {
        "@utils/": "./../src/utils/",
      }
    }
    And I am importing in the file like this:
    Copy code
    js
    // my-function/index.ts
    import { item } from '@utils/transform/item.transform.ts';
    Is there any way to import files relative to the edge function index?
    b
    • 2
    • 2
  • Help with Database function?
    p

    Phillip

    05/10/2023, 4:43 PM
    I have a table called reviews, on insert > after the row has been written, I want to update the table that the review was made on Resource. Im new to Psql and completely green on the functions side of things, See below any guidance would be apprecaited
    Copy code
    begin
      update public.resource set reviewratingavg = (select CAST (AVG(rating) AS float8) from public.review where resource::text = new.resource::text) where resource::text = new.resource::text;
      return new;
    end;
  • filters on realtime postgres_changes in flutter
    g

    goldyman

    05/10/2023, 4:48 PM
    So far I've seen only one example of how to use the filter prop and it was with one column and one condition. Does it support or and and in the fillter? Like
    Copy code
    body=eq.1234|body=eq.98756
    g
    • 2
    • 3
  • postgres database
    y

    yawn

    05/10/2023, 4:57 PM
    is there a way to migrate all data from sqlite3 database to supabase postgres? need it
    n
    • 2
    • 2
  • Watcher Process hang up on "supabase serve"
    b

    bilals

    05/10/2023, 4:59 PM
    After running this command: npx supabase functions serve function1 -> Found 1 errors. ->Watcher Process finished. Restarting on file change... I fixed the error, but its not restarting. Why is that happening?
  • cant get location or geocode
    a

    Ace

    05/10/2023, 5:00 PM
    I keep running into basic errors like this user here: https://github.com/supabase/supabase/issues/10631 Type "norm_addy" doesn't exist and other similar errors. Can someone please explain an end to end run through of a simple geocode of an address or zip code or something of the sort?
    g
    • 2
    • 15
1...208209210...230Latest