https://supabase.com/ logo
Join Discord
Powered by
# help-and-questions
  • How to backup remote database?
    k

    Kellen Mace

    03/16/2023, 3:17 AM
    I'm trying to follow along with this docs page (https://supabase.com/docs/guides/platform/migrating-and-upgrading-projects#migrate-your-project) to backup my database. When I run one of the db dump commands, like:
    Copy code
    supabase db dump --db-url "postgresql://postgres:MYPASSWORD@db.krpyriciwjyezbzvkmjo.supabase.co:5432/postgres" -f schema.sql --debug
    (replacing
    MYPASSWORD
    with the actual password for the
    postgres
    user) ...I get this:
    Copy code
    Dumping schemas from remote database...
    Error: Error running pg_dump on remote database: Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
    Two questions: 1. When the docs say to use the "database URL" is this what they mean? Am I supposed to use the full
    postgresql:// (etc.)
    connection string? 2. What am I doing wrong? Why can't I connect to the remote database? I have the latest versions of
    psql
    ,
    pg_dump
    and the supabase CLI installed, and I've been able to export my database in the past using the old method of setting the
    postgres
    user as a
    SUPERUSER
    , then running a
    pg_dump
    command to dump the database.
  • Tests failing with new functions
    j

    Jinni

    03/16/2023, 3:52 AM
    There seems to be new functions that are added in the docker image? Our tests are failing saying that there are new functions
    s
    • 2
    • 2
  • How to connect new supabase user to airtable?
    s

    Stuart81

    03/16/2023, 3:59 AM
    Hello everyone im wondering if i can connect supabase to airtable if so how?
    s
    • 2
    • 1
  • Is it ok to make a table with only one column: FK to auth.users.id?
    à

    àbć

    03/16/2023, 6:19 AM
    If I have a SaaS where users subscribe to the service and I have a table
    subscriptions
    with one column
    user_id not null references auth.users.id
    , and enable RLS so that only
    auth.uid() = user_id
    can
    select
    , is it ok to not add a
    is_subscribed bool not null
    because simply doing a query, RLS passing would indicate that they are subscribed? The existence of a row with their uid would mean they are subscribed. is this a valid way to go or nah?
  • Supabase Google auth integration with Capacitor (React) for iOS
    t

    Tissue

    03/16/2023, 6:50 AM
    Very similar to this post https://stackoverflow.com/questions/75671811/supabase-google-auth-integration-with-capacitor-react-for-ios/75752756#75752756 is there any known solution behind this? I am at this step and am a little lost as to why the token will not carry over to IOS. This works on web without issues
  • createServerComponentSupabaseClient with NextJs13 Error
    c

    claudemassaad

    03/16/2023, 6:58 AM
    Hi, i created a folder utils at the root directory and stored in it a file containing the supabase server client. i then import this client in a server component to fetch data from the database. I am getting this error, anyone can help? thank you
    m
    • 2
    • 1
  • Resolved : error npm run supabase:start @
    s

    Skills

    03/16/2023, 6:59 AM
    Error: Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running? in github.com/supabase/cli/internal/utils.AssertDockerIsRunning:48 in github.com/supabase/cli/internal/start.Run:35 Try rerunning the command with --debug to troubleshoot the error.
    r
    • 2
    • 18
  • Implementing hCaptcha on non-native mobile apps (in my case Ionic/Vue)
    g

    GaryLake

    03/16/2023, 7:44 AM
    Hey all, I'm in a world of pain here. I'm building a non-native app (Ionic/Vue) and I've got hCpatcha running a treat in dev when serving the app locally on my laptop by using a test domain etc. However, as soon as I push the app to the device for debugging/testing, it's running as localhost and the hCaptcha complains/won't proceed? How is anyone getting around this and is it going to be a problem on a real/published app? I know there are iOS and Android SDKs but the point of using non-native apps is to not have to get stuck in with this...
    • 1
    • 2
  • Implementing user roles for a job platform App being developed on Appsmith (Community Ed.) #appsmith
    s

    Saad

    03/16/2023, 7:58 AM
    Hi everyone, I am Abu. I am an intern working on building a job platform app, I have looked at few posts here in the Supabase Discord to try and find resources in achieving the goal mentioned in the title. I am using Supabase to authenticate users using both sign-in and sign-up APIs generated by Supabase. However, during Sign-up I want to store some information about the user such as first and last name, role, phone, country etc. so that it can be later stored in Appsmith store using the storeValue() function. I apologize if there's some specific terms being used which are relevant to Appsmith and is not understandable, but I hope my explanation has provided some clarity of what I am trying to achieve. I just found these resources from the discussion searches here: 1. https://github.com/supabase-community/supabase-custom-claims 2. https://github.com/supabase/supabase/discussions/11948 I am not certain if these will work, again I haven't tried it yet since my learning is a bit slow (I'm new to software development as a whole with no background in this, and also new to Appsmith and Supabase). Can you kindly give advice on whether I should follow these links or are there other resources which might be more suitable to my use-case? Thank you.
    g
    n
    • 3
    • 3
  • Permission denied to update profile on login
    v

    viktor

    03/16/2023, 8:36 AM
    So I have a profile table. One row per auth.user, where profile row id is the same as auth.users.id. I also have a trigger on auth.users on insert/update/delete that do changes in profile table. This is the login that triggers the permission denied.
    Copy code
    js
     await supabase.auth.signIn(
            { phone: fullPhoneNo.value },
            { redirectTo: window.location.origin }
        );
    This is the policy which should have given auth.users access. My guess is that there is another db user used for login?
    Copy code
    sql
    CREATE POLICY "auth.users can update own profile."
      ON public.profile FOR UPDATE USING (
        auth.uid() = id
      );
    This is my other policies related to auth.users trigger changes to profile. I guess I will get similar problems on some of them.
    Copy code
    sql
    CREATE POLICY "auth.users can select own profile."
      ON public.profile FOR SELECT USING (
        auth.uid() = id
      );
    
    CREATE POLICY "auth.users can insert own profile."
      ON public.profile FOR INSERT WITH CHECK (
        id = auth.uid()
        AND
        NOT exists (
          SELECT 1 FROM public.profile WHERE id = auth.uid()
        )
      );
    
    CREATE POLICY "auth.users can delete own profile."
      ON public.profile FOR DELETE USING (
        auth.uid() = id
      );
  • Prisma edge functions
    h

    hoj

    03/16/2023, 9:13 AM
    Anyone got prisma working with the deno edge functions? I can't seem to get the deno client library to work - it generates types in a node_modules but when accessing those types in the edge function with import { PrismaClient } from "npm:@prisma/client" the object is not typed at all. I might just use Prisma for handling migrations.
    r
    • 2
    • 2
  • Error with importing NPM module in my Discord bot function
    p

    Peanut

    03/16/2023, 9:28 AM
    I'm following the Discord bot guide (https://supabase.com/docs/guides/functions/examples/discord-bot) and the code uses an NPM module nacl (https://www.npmjs.com/package/nacl - latest version 0.1.3) but when I go to deploy it, I get this error:
    Copy code
    > supabase functions deploy discordbot --no-verify-jwt --import-map import_map.json "--import-map" "import_map.json"
    
    Version 1.30.3 is already installed
    Bundling discordbot
    Error: Error bundling function: exit status 1
    file:///src/import_map.json
    file:///src/index.ts
    error: Uncaught (in promise) Error: Module not found "npm:nacl@^0.1.3".
          const ret = new Error(getStringFromWasm0(arg0, arg1));
    My import (copied from article):
    Copy code
    // Sift is a small routing library that abstracts away details like starting a
    // listener on a port, and provides a simple function (serve) that has an API
    // to invoke a function for a specific path.
    import { json, serve, validateRequest } from "sift";
    // TweetNaCl is a cryptography library that we use to verify requests
    // from Discord.
    import nacl from "nacl";
    My import map:
    Copy code
    {
      "imports": {
        "nacl": "npm:nacl@^0.1.3"
      }
    }
    What is going wrong?
    r
    • 2
    • 16
  • [SOLVED] How does realtime broadcast and presence reflect on fees with Pro subscriptions?
    u

    オヌル

    03/16/2023, 9:56 AM
    Hi! Our company is making a game where we use realtime broadcast and presence to share a characters online status and position on the game world. https://supabase.com/docs/guides/realtime/broadcast I was wondering how much we can scale within our budget. Subscription page says we can have 500 concurrent Realtime connections and 5 million Realtime messages with our $25 plan. Does this mean max 500 people can subscribe to a realtime channel? The game we are making will probably have more than 40k people using as our last was around that. How much would it cost for only that? https://supabase.com/pricing I have contacted the sales but there has not been a reply for a week so I am asking here. Forgive me if this is the wrong place.
    g
    • 2
    • 3
  • Connection limits on realtime using self hosted?
    p

    peirix

    03/16/2023, 10:27 AM
    Hi, I was wondering if anyone knows what the limits are for concurrent connections on realtime when using a self hosted Supabase? I can't find anything in the docs. A quick test on my end shows that it seems to be 100, which is a bit low. I used the guide on setting it up with terraform and packer, so should I change any settings in there to allow more connections?
    r
    • 2
    • 5
  • How to use tweetnacl in my edge function
    p

    Peanut

    03/16/2023, 10:31 AM
    I am following the guide for a Discord bot (https://supabase.com/docs/guides/functions/examples/discord-bot) and it says to use tweetnacl (the code snippet is wrong but the comment above it is correct). I tweaked the import to an asterisk to make TypeScript happy but no combination of importing all, default or named imports works:
    Copy code
    // Sift is a small routing library that abstracts away details like starting a
    // listener on a port, and provides a simple function (serve) that has an API
    // to invoke a function for a specific path.
    // @ts-ignore
    import { json, serve, validateRequest } from "sift";
    // TweetNaCl is a cryptography library that we use to verify requests
    // from Discord.
    import * as nacl from "tweetnacl";
    
      const valid = nacl.sign.detached.verify(
        new TextEncoder().encode(timestamp + body),
        hexToUint8Array(signature),
        hexToUint8Array(PUBLIC_KEY)
      );
    But I get error
    Copy code
    Error serving request: TypeError: Cannot read properties of undefined (reading 'detached')
    My import map:
    Copy code
    {
      "imports": {
        "sift": "https://deno.land/x/sift@0.6.0/mod.ts",
        "tweetnacl": "https://unpkg.com/tweetnacl@^1.0.3"
      }
    }
    How do I properly use tweetnacl? I've also tried using the Deno re-package (https://deno.land/x/tweetnacl_deno@v1.0.3) but it says module not found Btw new to Deno, not new to Node/TS
    u
    r
    • 3
    • 3
  • resetPasswordForEmail
    a

    ahoogthomsen

    03/16/2023, 10:59 AM
    Hi peeps! This is my first time reaching out for help here. Happy to meet everyone! I'm encountering an issue with the supabase.auth.resetPasswordForEmail function that I can't quite understand. For some unknown reason, when I trigger this function, I don't receive any reset password email. Here's what my function looks like:
    Copy code
    const sendResetPasswordEmail = async ({
        email,
      }: Omit<EmailAndPassword, 'password'>) => {
        console.log({ email });
        const { data, error } = await supabase.auth.resetPasswordForEmail(email);
        console.log({ data, error });
        return { data, error };
      };
    This is what i receive from the console.logs:
    Copy code
    LOG  {"email": "ahoog****@gmail.com"} (my correct email, blurred out of obvious reasons, however the correct one :) )
     LOG  {"data": {}, "error": null}
    I can see in my users table that the user with the email is in the list of verified users (I've also tried to log in with that user, and it works successfully). Does anyone have a clue why this isn't working? Side note: I also tried to manually trigger a password recovery email via the Supabase dashboard, and that doesn't initiate a sendout either.
    g
    • 2
    • 1
  • is there a way to access the client headers from postgres?
    i

    itisnajim

    03/16/2023, 1:17 PM
    using the supabase client sdk i can set the headers:
    Copy code
    dart
    final client = SupabaseClient(
          'URL_HERE',
          'ANNON_KEY',
          headers: {
            'X-Client-Info': 'supabase-dart/1.6.0',
            'header_name': 'header_value',
          },
        );
    i want to access header_name value, using something like:
    Copy code
    sql
    select current_setting('request.header_name', true);
    how can i achieve this?
    g
    r
    • 3
    • 14
  • How to use Supabase JS SDK in Edge function
    p

    Peanut

    03/16/2023, 2:52 PM
    I'm following [this guide](https://github.com/supabase/supabase/blob/master/examples/edge-functions/supabase/functions/select-from-table-with-auth-rls/index.ts) for selecting data using the JS SDK but it doesn't work my Edge function and I get:
    Copy code
    Error serving request: TypeError: Cannot read properties of undefined (reading 'href')
        at getParameterByName (https://deno.land/x/gotrue@3.0.0/src/lib/helpers.ts:13:37)
        at new GoTrueClient (https://deno.land/x/gotrue@3.0.0/src/GoTrueClient.ts:58:61)
        at new SupabaseAuthClient (https://deno.land/x/supabase@1.3.1/src/lib/SupabaseAuthClient.ts:4:9)
        at SupabaseClient._initSupabaseAuthClient (https://deno.land/x/supabase@1.3.1/src/SupabaseClient.ts:136:16)
        at new SupabaseClient (https://deno.land/x/supabase@1.3.1/src/SupabaseClient.ts:55:26)
        at createClient (https://deno.land/x/supabase@1.3.1/src/index.ts:5:12)
        at Object.home [as /discordbot] (file:///src/index.ts:65:32)
        at async handleRequest (https://deno.land/x/sift@0.6.0/mod.ts:58:36)
        at async Server.#respond (https://deno.land/std@0.154.0/http/server.ts:219:24)
    I tried switching the variable to
    SUPABASE_DB_URL
    and also setting my own secret var but it doesnt work My code:
    Copy code
    import { createClient } from "@supabase/supabase-js";
    
        const supabaseClient = createClient(
          Deno.env.get("SUPABASE_URL") ?? "",
          Deno.env.get("SUPABASE_ANON_KEY") ?? ""
        );
    • 1
    • 1
  • Updating a Parent Table using the JS client, throwing 42703 errors
    m

    Matthew 🦘🫕

    03/16/2023, 3:21 PM
    I have a parent table decks and a child table cards when I try to update decks using the js client I get the attached error, am I doing something wrong? Here is my update code that I just copied from the vuejs admin page tutorial
    Copy code
    js
    async updateDeck(deck: DeckUpdate) {
          console.log("Pinia Update Deck", deck);
          try {
            const { error } = await supabase
              .from('decks')
              .upsert(deck)
    
            console.log(error)
            if (error) throw error;
    
          } catch (error) {
            console.log(error);
          }
        }
    Here is the deckCreate model aswell
    Copy code
    js
    export interface DeckCreate {
      user_id: number;
      name: string;
      description: string;
    }
    
    export interface DeckUpdate extends DeckCreate {
      id: string;
    }
    g
    • 2
    • 4
  • Error on Sign up using Sign Up API
    s

    Saad

    03/16/2023, 3:32 PM
    Hi, I am using Supabase to authenticate users in Appsmith on sign up using the sign up API from Supabase cloud. Upon running the API query it sends a verification email which has a link attached to it to verify the details and complete signing up. The problem is upon clicking the link the user is led to this page with the error in the picture shown. Although the Appsmith, is still running locally and the sign-in query works just fine. I am not sure why I am getting this error. Even though I get this error after checking Supabase , it seems that the user info is still being registered on Supabase. How do I debug this error since intuitively the user will get confused and keep trying to sign up always.
  • Permission denied for schema public
    v

    viktor

    03/16/2023, 3:40 PM
    I restored dev database to last nights backup throught supabase dashboard. It seems to not have persisted changes to permissions or grants? I get
    [42501] ERROR: permission denied for schema public
    as user postgres when trying to
    Copy code
    sql
    ALTER VIEW public.my_view OWNER TO authenticated;
    I've tested
    GRANT ALL PRIVILEGES ON SCHEMA public TO postgres;
    I also get
    permission denied for schema public
    when supabase_auth_admin tries to insert into a public table through a trigger.
  • Cannot filter select results in TypeScript
    p

    Peanut

    03/16/2023, 3:43 PM
    I am trying to perform an
    .is()
    operation on my Select query:
    Copy code
    let query = supabaseClient
              .rpc("searchassets", {
                searchterm: searchTerm,
              })
              .select("*")
              .limit(10)
              .order("rank", {
                ascending: false,
              });
    
            query = query.is("isadult", false);
    I get error
    Copy code
    Property 'is' does not exist on type 'PostgrestTransformBuilder<any, any, { [x: string]: any; }[]>'.ts(2339)
    How do I fix this? Do I have to cast my query or something? If I @ts-ignore it goes away and still works
    t
    • 2
    • 5
  • Hi I have an url I would like to store the image of it in storage.
    k

    killerthief

    03/16/2023, 3:54 PM
    https://oaidalleapiprodscus.blob.core.windows.net/private/org-ly5GphjXTO7U5GawU4ToSrUu/user-el5TfuXeAaNqiu9Z477Xlx3Q/img-sfdok7NCR9bSGKLbEGl1jROr.png?st=2023-03-16T13%3A57%3A48Z&se=2023-03-16T15%3A57%3A48Z&sp=r&sv=2021-08-06&sr=b&rscd=inline&rsct=image/png&skoid=6aaadede-4fb3-4698-a8f6-684d7786b067&sktid=a48cca56-e6da-484e-a814-9c849652bcb3&skt=2023-03-16T10%3A53%3A21Z&ske=2023-03-17T10%3A53%3A21Z&sks=b&skv=2021-08-06&sig=36tOUEm788z7fneJ7TFAPyienZXcCQ3NXIFKGtZEGYE%3D I have this url I want to store the image in supabase storage everything I have tired has failed to work what is the best solution , this is taking place in backend node js express j s
    • 1
    • 1
  • Difference adding tables via the table editor and sql editor
    a

    Absolution585

    03/16/2023, 3:59 PM
    Hello. I know very little still about working with databases. I used the step by step instructions to make a connection to Supbase via SvelteKit. I created a new table using the table editor and replaced the countries references from the countries table to the new table, but that didn't work. After 6 hours of struggling I tried generating the table using the SQL editor. This solved my problem of getting empty arrays. So my question is, what is the difference between creating tables via the table editor and the SQL editor? Thank you for reading.
    g
    • 2
    • 1
  • recaptch\hcaptcha without auth
    y

    yoni7022

    03/16/2023, 4:26 PM
    Hello guys, i have a react + supabase app without sign up and login, and i want to implement a Recaptcha or hcaptcha for a post form, is there a way to do it?
    n
    • 2
    • 4
  • Fetch active users in last 7 days ?
    s

    Sumit1993

    03/16/2023, 5:11 PM
    Hi can anyone let me know how to get the count of active users in last 7 days using the sdk?
    n
    r
    s
    • 4
    • 14
  • Getting permission error while using function for auth user table
    s

    Sumit1993

    03/16/2023, 5:18 PM
    I am getting permission error while trying to use function / trigger on auth user table row update... can anyone check this and help me out? Log ID dfd11bf1-8b1e-417b-95e4-a80dc0b4c909 Log Timestamp (UTC) 2023-03-16T17:00:13.888Z Log Event Message permission denied for table users Log Metadata [ { "file": null, "host": "db-xjmlfisuihxfggsbrhbo", "metadata": [], "parsed": [ { "application_name": null, "backend_type": "client backend", "command_tag": "UPDATE", "connection_from": "127.0.0.1:47768", "context": "SQL statement \"UPDATE public.users\r\n SET last_sign_in_at = NEW.last_sign_in_at\r\n WHERE id = NEW.id\"\nPL/pgSQL function public.update_last_sign_in_at() line 9 at SQL statement", "database_name": "postgres", "detail": null, "error_severity": "ERROR", "hint": null, "internal_query": null, "internal_query_pos": null, "leader_pid": null, "location": null, "process_id": 175485, "query": "UPDATE \"users\" AS users SET \"role\" = $1, \"updated_at\" = $2 WHERE users.id = $3", "query_id": 495668919303856000, "query_pos": null, "session_id": "63fb0a4d.2ad7d", "session_line_num": 19, "session_start_time": "2023-02-26 07:29:17 UTC", "sql_state_code": "42501", "timestamp": "2023-03-16 17:00:13.888 UTC", "transaction_id": 1694, "user_name": "supabase_auth_admin", "virtual_transaction_id": "10/28979" } ], "parsed_from": null, "project": null, "source_type": null } ]
    g
    n
    • 3
    • 2
  • How do I insert an array of values (but no columns) into a table with columns using db functions?
    d

    Dash

    03/16/2023, 5:18 PM
    I have many arrays that looks like this: [1, "red", 20, "yes", ...] with 25 values and want to insert them into a table with 25 columns. I want each array to be a new row. When I try inserting, it adds all the values just in the first column, and the rest of them remain null.
    • 1
    • 1
  • Strange server error after enabling realtime
    j

    jeffarizona93

    03/16/2023, 5:20 PM
    After enabling realtime to listen to database changes I started periodically receiving this error message in my server logs
    Copy code
    [ERROR] Consecutive reporter failure limit hit. No further attempts will be made.
    I checked through the docs and couldn't find a match to anything. Also the realtime is working as expected. Anyone seen this error before?
  • Is there any way to resend Email OTP for verification?
    i

    Irfan Ahmed

    03/16/2023, 6:14 PM
    I am using supabase auth with email verification using OTP, I need to resend OTP confirmation email in case if the user didn't received the email or it got deleted, or the OTP expired. Please suggest.
    s
    r
    • 3
    • 3
1...169170171...230Latest