https://supabase.com/ logo
Join DiscordCommunities
Powered by
# javascript
  • c

    CalvinTorra

    08/05/2021, 5:57 PM
    How do I add to the cell that already exists. eg: I have a row with a col named "website" How do I add another website to this cell....like an array or something. Before: "google(dot)com" After: "google(dot)com, apple(dot)com" Looking at the docs and sending data, update seems to overwrite the current content. Thank you. https://supabase.io/docs/reference/javascript/update
    b
    • 2
    • 4
  • b

    burggraf

    08/06/2021, 1:14 AM
    How to add to a cell
  • k

    Khan W

    08/06/2021, 3:58 AM
    Is there a way to print the sql that's generated when creating a query?
  • k

    Khan W

    08/06/2021, 3:58 AM
    EG: I use
    supabase.from("users").select()
    , and get out
    SELECT * FROM users;
  • l

    lawrencecchen

    08/06/2021, 4:18 AM
    supabase.from(...)... is converted into a postgrest query (https://postgrest.org/en/stable/api.html), which is then converted to sql on the postgrest server. afaik, you can't directly get the sql
  • m

    Max Karlsson

    08/06/2021, 4:33 AM
    I'm trying to verify a user session server side using the
    access_token
    retrieved from the session. But when I pass the token to
    supabase.auth.api.getUser
    it always returns null for the user and the following error:
    TypeError: this._createRequestHeaders is not a function
    what could I be doing wrong?
    Edit: nvm, I didn't use the service key 🤦‍♂️
  • k

    Khan W

    08/06/2021, 4:55 AM
    Ah that makes sense, I forgot for a second there that there was a middleman (PostgREST). Thanks!
  • s

    Sduu_

    08/06/2021, 9:19 AM
    To those who use Vue 2.x and Vue 3.x, the
    vue-supabase
    now supports both without much differences in setup and installation, thanks to the
    vue-demi
    package. Please do check it out and help with making it more robust. More use of the package will help us identify places that need love and attention. https://github.com/supabase/vue-supabase
  • s

    Sduu_

    08/06/2021, 9:19 AM
    Oh, there is also https://github.com/supabase/nuxt-supabase
  • s

    Sduu_

    08/06/2021, 9:20 AM
    But the examples in the @User website do not use these, although it's not a train smash, I would have loved to see those there
  • s

    silentworks

    08/06/2021, 9:27 AM
    You can create an example with these and submit a PR
  • s

    Sduu_

    08/06/2021, 9:28 AM
    Will work on it, probably later today. I'm not sure how much next.js xp I'll need but I hope it's not too much. I'll go through closed PRs for examples. I don't know much react 😆
  • w

    wilfredinni

    08/06/2021, 11:11 PM
    Hi! I'm trying to delete an image from a bucket using
  • w

    wilfredinni

    08/06/2021, 11:11 PM
    Copy code
    const { data, error } = await supabase.storage
            .from('avatars')
            .remove(['image_path'])
    a
    • 2
    • 2
  • w

    wilfredinni

    08/06/2021, 11:11 PM
    But the image is not deleted, nor I get an error
  • a

    Azura

    08/07/2021, 6:18 AM
    Unable to upload image to DB
  • y

    YANN

    08/07/2021, 9:51 AM
    Really cool, i was forced to use a store for supabase before knowing it, guess it's a cleaner approach
  • e

    e0

    08/07/2021, 4:23 PM
    I'm looking through the JavaScript library for using filters. Is it possible to compare two columns with each other? For example in sql it would be something like this:
    select * from games where first_half_goals > second_half_goals
    .
  • e

    e0

    08/07/2021, 4:49 PM
    Did some digging and found this thread https://github.com/PostgREST/postgrest/issues/1105 so it looks like it's not possible. I have several columns which need to be compared with each other. I think it should work if I create a stored procedure to handle this dynamic model-model comparison since it looks like
    rpc()
    can be chained.
  • b

    burggraf

    08/07/2021, 6:06 PM
    This is the right approach for this. 👍
  • m

    marcustut

    08/09/2021, 4:20 AM
    I'm trying to create public url from a folder, I notice that I have to set these policies, but is there a template for this?
  • m

    marcustut

    08/09/2021, 4:21 AM
    Copy code
    sql
    (
      (
        (bucket_id = 'mooncake':: text)
        AND (storage.extension(name) = 'jpg':: text)
      )
      OR (storage.extension(name) = 'jpeg':: text)
      OR (storage.extension(name) = 'png':: text)
      OR (
        (storage.extension(name) = 'pdf':: text)
        AND (
          lower((storage.foldername(name)) [ 1 ]) = 'receipts':: text
        )
        AND (role() = 'anon':: text)
      )
    )
    I tried this but doesn't work
  • n

    noravux

    08/09/2021, 2:31 PM
    Are there any security concerns / stuff I should be aware of when using Supabase with React Native and Async Storage, regarding for example tokens?
    s
    • 2
    • 4
  • o

    octalpixel

    08/09/2021, 8:55 PM
    Hey guys! Is there any write on using Supabase for React Native ? Would love to know how to get started on it
  • s

    Scott P

    08/09/2021, 9:08 PM
    Exactly the same as using it with any JS framework. One thing to consider is auth though, you need to provide storage: https://supabase.io/docs/reference/javascript/auth-signin#sign-in-using-a-refresh-token-eg-in-react-native
  • l

    leviwhalen

    08/10/2021, 4:40 AM
    Hey all! I’m trying to build some search functionality that can resolve data from multiple tables depending on the context. Would it make more sense for me to write the table switching logic outside of the js api or is there a way I can do text search on multiple tables at once? For example, a user puts a street address into search which should return a real estate property. The same search box can be used to retrieve user profiles as well. I know I can query multiple tables as separate requests, but I’d love to do it in a single request. I’m really new to SQL and Postgres so forgive me if the answer is obvious!
    k
    b
    • 3
    • 7
  • k

    Kosh

    08/10/2021, 6:18 AM
    nested query
  • m

    Mihai Andrei

    08/10/2021, 6:19 AM
    Hey guys! A little question for those who use NextJS or NuxtJS. How to you guys handle authentication? Client side, or on the SSR side of those frameworks?
    e
    j
    +2
    • 5
    • 15
  • a

    ankurpauldev

    08/10/2021, 8:02 PM
    It is scary to do handle auth on client-side! I suggest go SSR. That might be safe in the long run.
  • s

    stibbs

    08/11/2021, 6:16 AM
    Anyone here using sveltekit endpoints and also row level security on their table? Struggling to get a select query working 😩
1...789...81Latest