https://supabase.com/ logo
Join Discord
Powered by
# help-and-questions
  • Store encrypted text potentially containing \u0000 in Supabase Postgresql database
    c

    chit

    05/24/2023, 9:49 AM
    Trying to store encrypted text using crypto-js AES in Supabase Postgres database, I want the encoded string to be as short as possible, so I convert the base64 result from the encryption function using
    atob
    to a binary string, as it occupied less characters. I then want to store this result in the Supabase Postgres database, but sometimes the encrypted binary string consists \\u0000, which triggers the error
    ERROR: unsupported Unicode escape sequence Detail: \u0000 cannot be converted to text.
    I was told that [PostgresSQL does not plan to suport \\u0000 as nul-terminated strings is used a lot in the backend](https://www.postgresql.org/message-id/8239.1500489054%40sss.pgh.pa.us). my encryption and decryption function:
    Copy code
    export function encryptText(text, key) {
      return window.atob(AES.encrypt(text, key).toString());
    }
    
    export function decryptText(text, key) {
      return AES.decrypt(window.btoa(text), key).toString(enc.Utf8);
    }
    Is there any other way to achieve my goal of storing encrypted text inside Supabase Postgres with as little character as possible? I've tried assing
    .trim()
    after the text is encrypted, to remove any trailing \\u0000. I've also thought about replacing \\u0000 with other characters, but I if I do so, how can I accurately un-replace it before I call the decryption function?
    g
    • 2
    • 1
  • Auth Refresh Session
    m

    Masini

    05/24/2023, 10:40 AM
    I'm slightly confused by the docs for the Javascript client library function supabase.auth.refreshSession() "Returns a new session, regardless of expiry status. Takes in an optional current session. If not passed in, then refreshSession() will attempt to retrieve it from getSession(). **If the current session's refresh token is invalid, an error will be thrown.**" The last part seems a bit ambiguous when compared to the first sentence, stating that a new session is returned regardless of expiry status, but if the current session refresh token is invalid an error is thrown. Just for clarification, I am assuming that an invalid refresh token is not the same as an expired one? And how can a refresh token be invalid? I am using React Native Expo for my project and I'm implementing functionality such that when the app is backgrounded for some time, upon entering the foreground the session token is refreshed. Any help would be highly appreciated! šŸ™‚
    j
    • 2
    • 2
  • update a single cell
    g

    Grimmjoww231

    05/24/2023, 11:06 AM
    hey guys. im trying to update a single cell in supabase but it seems to reset the other ones in the row. i googled for some time and all i seem to see is that supabase only handles one row at a time updates. did we get past this or is it still the case ?
    s
    • 2
    • 20
  • data/options not updating after first signup request.
    e

    EKI

    05/24/2023, 11:24 AM
    When a user1 signs up with some email but that email is mistype or belongs to other they might try to signup again but with correct email id, but the issue here is that user2 whose email is already in our auth.users table which is mistakenly used for signup by user1, there data do not update on other/new signup request. It sends confirm email though.
  • Studio not working for local dev when I have not internet connection
    g

    Geoff

    05/24/2023, 11:55 AM
    Hi there, I have Supabase setup for local dev using Docker, per the instructions in the docs. I can query and modify data in the database from code, but the Studio interface running on localhost just sits there indefinitely waiting for something, without letting me interact with it. For example, the screenshot shows what I see when I click on the Table editor tab. And ideas? Thank you!

    https://cdn.discordapp.com/attachments/1110898839994515556/1110898840208408606/image.pngā–¾

  • Chain .single() and .returns in supabase-js
    t

    TheRien

    05/24/2023, 1:03 PM
    I have a custom return type, something like this:
    Copy code
    type Post = Database['public']['Tables']['posts']['Row'] & {
      comments: Database['public']['Tables']['comments']['Row'][]
    }
    And I have the following query:
    Copy code
    const postId = 1;
    supabase.from('posts').select('name, comments(description)').eq('id', postId).limit(1).single().returns<Post>();
    However, this gives an error:
    Property 'returns' does not exist on type 'PostgrestBuilder<.....>
    So how can I use a custom type and retrieve one row? Or is this a bug in supabase-js?
    g
    • 2
    • 2
  • Realtime on Cloudflare Workers
    h

    happenator

    05/24/2023, 1:55 PM
    Has anyone use realtime broadcast channels on Cloudflare Workers? I'm getting the error
    Error: WebSocket Constructor: The protocols array cannot be empty.
    when calling
    client.subscribe
    . I assume it has something to do with the Cloudflare runtime environment not being a full Node environment.
    g
    • 2
    • 6
  • Single table failing
    g

    greenteacoffee

    05/24/2023, 2:05 PM
    Hello! As of this morning our production database has a single table failing. When running select on the table we get: An error has occurred: NetworkError when attempting to fetch resource. Anyone have any thoughts? Some logging such as postgrest is also broken.
    s
    • 2
    • 1
  • Prisma, vector embeddings -> Error: schema "extensions" does not exist
    v

    Vinny

    05/24/2023, 2:09 PM
    So I'm trying to set up Prisma with the unsupported vector type. I've enabled the vector extension in the dashboard. My schema.prisma file looks like this:
    Copy code
    js
    
    datasource db {
      provider = "postgresql"
      url      = env("DATABASE_URL")
      extensions = [pgvector(map: "vector", schema: "extensions")] 
    }
    
    generator client {
      provider = "prisma-client-js"
      output = env("PRISMA_CLIENT_OUTPUT_DIR")
      previewFeatures = ["postgresqlExtensions"]
    }
    
    model Text {
      id Int @id @default(autoincrement())
      title String
      content String
      vector Unsupported("vector (1536)")
    
    }
    My initial migration works, but I keep getting this error on subsequent migrations:
    Copy code
    ERROR: schema "extensions" does not exist
    • 1
    • 1
  • magic link emailRedirectTo always going to localhost:3000 in Netlify prod.
    w

    Waterpile

    05/24/2023, 2:24 PM
    Env is on Netlify running NextJS 13 app directory using supabase-js. When using magic link on localhost, emailRedirectTo option is being configured dynamically correctly, but when using magic link on prod Netlify domain, redirect parameter is always set to localhost:3000. I've tried manually setting the emailRedirectTo option, removing any dynamic values altogether, still only redirects to localhost:3000.
    g
    • 2
    • 2
  • REINDEX INDEX index_name; failing with "An error has occurred: Failed to fetch"
    i

    Ishaan - berri.ai

    05/24/2023, 3:19 PM
    I'm trying to re index my table and it's been failing with An error has occurred: Failed to fetch Any idea what could be going wrong ?
    g
    • 2
    • 4
  • Local Dev, Reset DB Password
    v

    Vigne

    05/24/2023, 3:25 PM
    Hello how do I reset my postgres password for local development image ?, I tried to reset it from local studio but the setting menu was not found for local development
    g
    v
    s
    • 4
    • 4
  • Need advice on "public.messages" database schema
    v

    ven

    05/24/2023, 4:13 PM
    Hi - I made a back of the envelope schema for a messaging system we are developing for our app. Would love to hear your thoughts if this schema looks right and if there are opportunities to improve. thanks
    g
    s
    • 3
    • 5
  • Realtime listener with multiple constraints
    z

    zerosodium

    05/24/2023, 4:15 PM
    Hi, I'm creating a realtime listener to listen to changes in my bids table. Each bid has a reservation_id to signify what reservation the bid belongs to. For my listener, I need to listen to make sure it doesn't listen to all bids, but only where the bid's reseveration equals "x", "y" or "z". Here is what I have now:
    Copy code
    js
     useEffect(() => {
        const bidsSubscription = supabase
          .channel("any")
          .on(
            "postgres_changes",
            {
              event: "*",
              schema: "public",
              table: "bids",
            },
            (payload) => {
              console.log(payload);
            }
          )
          .subscribe();
    
        return () => {
          supabase.removeAllChannels();
        };
      }, []);
    I understand I can filter like
    filter: 'reservation_id=x'
    but can I chain these together?
    g
    • 2
    • 9
  • Where can I find a full list of possible error status/name/messages for supabase-js?
    s

    silas

    05/24/2023, 4:20 PM
    I simply want to handle all possible errors in the best way possible—and I can’t do that without knowing the possible auth errors that can be returned from functions like supabase.auth.signInWithPassword()
  • Can you use GitHub App with the GH auth provider instead of GitHub OAuth App?
    c

    covalenta

    05/24/2023, 5:04 PM
    I want to use the OAuth flow with the GitHub App instead of GitHub OAuth App. I actually managed to get it partially working but there are still some errors. It is possible to use auth this way?
  • A/B Testing, Feature Flags
    k

    kevlust

    05/24/2023, 5:07 PM
    Does Supabase offer any way for me to run A/B tests on features, or to be able toggle them on/off from the dashboard? I haven't seen anything about this on the website. It's always possible to do this in kind of a hacky way, but it would be an awesome and incredibly useful feature!
  • After login with discord auth how can get users guilds?
    v

    vikay

    05/24/2023, 5:43 PM
    hello basically after auth with supabase how can we get the users guilds map?
  • Want advice for a feature addition
    w

    Will_Buyers

    05/24/2023, 5:47 PM
    I am making a educational site for a school. I wanna a make feature where all students are watching a video together from bunch of videos at different URL, they can ASK QUESTION (in Live chat) alongside watching. I want to implement this feature at all the URLs.
    • 1
    • 1
  • Managing Environments doc / demo discrepancy (GitHub Actions)
    w

    Waldemar

    05/24/2023, 6:27 PM
    I'm was following this guide: https://supabase.com/docs/guides/cli/managing-environments#configure-github-actions But the .github/workflows in the linked demo repo are different than in the guide: https://github.com/supabase/supabase-action-example Which one should I trust more?
  • Supabase projects dashboard down
    m

    minjunes

    05/24/2023, 6:34 PM
    Hey @garyaustin @Olyno, the projects page https://app.supabase.com/projects isn't loading for the past 10 minutes. Tried clearing cache, no luck. In general, data in Projects and Organizations is not loading. Notifying here in case it is systemwide, not just one-off case for me.
    o
    g
    t
    • 4
    • 12
  • failed to retrieve generated types: {"message":"upstream request timeout"}
    c

    coop

    05/24/2023, 6:34 PM
    Anyone not able to generate types with the CLI? mine has started failing
    • 1
    • 2
  • Making an ILIKE query by using REPLACE
    k

    KiwiHour

    05/24/2023, 6:41 PM
    I have a postgresql query
    Copy code
    sql
    SELECT name FROM table WHERE REPLACE(name, ' ', '') ILIKE 'kiwi%'
    How can I reproduce the replace function this using the supabase JS/TS client?
    g
    • 2
    • 2
  • Are there any plans to support hosting for web apps?
    s

    stephenhandley

    05/24/2023, 7:34 PM
    Wondering whether there are any plans to support similar functionality to https://firebase.google.com/docs/hosting I know there are plenty of other great solutions out there for this purpose (firebase, vercel, netlify, cloudflare, etc.) but that means having to use multiple providers. Again, not that big of a deal, but it would be great to be able to use Supabase as a web dev teaching tool where people learning would only have to use one provider, and the only real missing piece with Supabase is being able to host the app itself.
    g
    • 2
    • 2
  • no delete option in Supabase UI
    t

    terrxo

    05/24/2023, 8:06 PM
    I can't remove mfa_factors, I have tried using the "remove MFA factors" which does absolutely nothing, also no delete row button in table view. Can anyone help, this is becoming frustrating..

    https://cdn.discordapp.com/attachments/1111022415120715896/1111022415292674068/image.pngā–¾

    g
    • 2
    • 2
  • Error in lib_api__WEBPACK_IMPORTED_MODULE
    d

    damith98kumara

    05/24/2023, 8:17 PM
    I'm new to the Supabase, I have trying to configure the first example of todo list in ReactJS. but in that I have got the Error like below can you help to solve that Error. Uncaught TypeError: _lib_api__WEBPACK_IMPORTED_MODULE_1__.supabase.auth.session is not a function at App.js:10:1

    https://cdn.discordapp.com/attachments/1111025083973107732/1111025084166066228/Screenshot_2023-05-25_014544.pngā–¾

    https://cdn.discordapp.com/attachments/1111025083973107732/1111025084526768218/Screenshot_2023-05-25_014622.pngā–¾

    s
    • 2
    • 1
  • Deleted tables from auth schema now I can't create users
    i

    iiPhaNatiCx

    05/24/2023, 8:27 PM
    So I am using Prisma and was trying out
    previewFeatures = ["multiSchema"]
    . In doing so, when I ran
    npx prisma db push
    it dropped the tables from the
    auth
    schema in Supabase. Now when I try to create a user via UI or
    supabase.auth.admin.createUser()
    I get the following error:
    AuthApiError: Database error checking email
    . Has anyone ever ran into this before? Or is there a way I can restore the tables? Not looking to recover any data, just want to be able to create users again.
    g
    n
    • 3
    • 16
  • helper function 'getSession' in hooks.server.ts doesn't refetch new session data
    t

    terrxo

    05/24/2023, 8:57 PM
    The function when ran, fetches data no longer existing on supabase. Any suggestions?

    https://cdn.discordapp.com/attachments/1111035153003851888/1111035153230348379/image.pngā–¾

    j
    • 2
    • 1
  • Waiting for session to load with useSession()
    m

    MATTI

    05/24/2023, 9:05 PM
    When using useSession() from the auth-helpers-react, how do I wait for the session to be loaded? I am trying to redirect the user to sign in page, if there is no session. But it seems that the session is always NULL before the session is set to the session value or NULL. How do I make sure whether the session is actually null, and no just loading?
    n
    • 2
    • 6
  • SMTP Minimum Interval
    m

    Micheal

    05/24/2023, 9:07 PM
    Is this 60 seconds to a specific user or will it rate limit 1 email per 60 seconds globally?

    https://cdn.discordapp.com/attachments/1111037729938079784/1111037730068111440/image.pngā–¾

1...225226227...230Latest