https://supabase.com/ logo
Join Discord
Powered by
# javascript
  • p

    Prefix

    12/28/2021, 9:24 PM
    Is anyone struggling to get row-level realtime subscriptions working? I've noticed when I use the catch-all subscription, things work as I expect, however if I switch to row-level, I don't receive any updates. ie:
    Copy code
    typescript
    // ✅ this is working correctly (able to receive INSERT, UPDATE and DELETE events for the `board_cards` table):
    const subscription = await supabase
      .from('*')
      .on('*', handler)
      .subscribe();
    
    // ❌ this is NOT working correctly (unable to receive INSERT, UPDATE and DELETE events for the `board_cards` ):
    const subscription = await supabase
      .from(`board_cards:list_id=eq.${someId}`)
      .on('*', handler)
      .subscribe();
    g
    • 2
    • 9
  • g

    garyaustin

    12/28/2021, 9:41 PM
    row level realtime not working
  • w

    willm

    12/28/2021, 10:56 PM
    Is there a good way to sort through arrays in the DB? For example, I have an array of names as one of the columns. Is there a way to filter for rows where a certain name appears in that array?
  • g

    garyaustin

    12/29/2021, 12:17 AM
    I'm guessing you are looking for .contains('main_exports', ['oil']) from the Supabase js filters. main_exports is an array column.
  • w

    willm

    12/29/2021, 12:23 AM
    Fantastic. Thank you.
  • w

    willm

    12/29/2021, 12:23 AM
    So in that case if oil is in the array it would return it?
  • n

    Null

    12/29/2021, 2:13 AM
    Anyone know why arrays are always returning empty when clearly having a value? Im trying to get back a row and the column is defined as an array, but when I fetch it the array is completely empty.
  • n

    Null

    12/29/2021, 2:22 AM
    Been trying to figure this out since the beginning of the month. Its so bizarre
  • n

    Null

    12/29/2021, 2:25 AM
    Btw I should mention this happens when grabbing from the new payload
  • n

    Null

    12/29/2021, 2:25 AM
    im using real time insert
  • w

    willm

    12/29/2021, 5:14 AM
    I just used an array for the first time and didn’t run into this
  • n

    Null

    12/29/2021, 5:15 AM
    Did you fetch the data with realtime? Im reading from the
    payload.new
    variable
  • w

    willm

    12/29/2021, 5:34 AM
    Not too familiar with real-time, new to supabase
  • w

    willm

    12/29/2021, 5:34 AM
    I just got the column from the DB and the array was there
  • n

    Null

    12/29/2021, 3:23 PM
    Yea that works fine for me as well, but when fetching with real-time data for whatever reason it returns empty.
  • h

    Haba

    12/29/2021, 8:05 PM
    How I can use realtime db with Row level security? In Vue I'm trying to use code from docs (https://supabase.com/docs/reference/javascript/subscribe#listening-to-row-level-changes)
    Copy code
    mounted(){
    supabase
          .from(`Cards:uid.${this.$store.state.user.id`}) \\ or 'Cards'
          .on('*', (payload) => {
            console.log('Change received!', payload);
          })
          .subscribe();
    }
    Cards is a Table uid it's a column with user auth id and this doesn't work for me :/ Any ideas?
    g
    • 2
    • 1
  • g

    garyaustin

    12/29/2021, 8:26 PM
    realtime question with RLS, vue
  • t

    TremalJack

    12/30/2021, 2:02 PM
    someone made web push notification using supabase?
  • n

    Null

    12/30/2021, 8:16 PM
    When a user logs in, my app doesn't detected its logged in until the page is refreshed. I'm using Google Auth. How do I fix this?
  • p

    poutingemoji

    12/31/2021, 1:58 AM
    is there a way to modify the items im inserting into my supabase table from the editor and inserting a foreign key i retrieved from another table. i wanted a way to be able to do this without having to pick a foreign key and assigning it through the sdk
  • l

    lorencerri

    12/31/2021, 4:10 PM
    I’m not sure if there’s a better way, but I used this to detect whether or not the user signed in or out on the webpage using an external oauth2 method https://supabase.com/docs/reference/javascript/auth-onauthstatechange
  • d

    DevilsBlade0

    01/01/2022, 9:30 AM
    Hi guys, just wondering if anyone can point me through the right direction, I’m making a business directory where users can review a business by leaving a rating from. 1-10 I have a table with all the business names and details. How would implement a voting system for only logged in users. I was thinking adding a column with a count of votes, but don’t know how to make sure logged in users can vote once
    t
    • 2
    • 14
  • d

    DevilsBlade0

    01/01/2022, 9:30 AM
    Thank you!
  • t

    tourdownunder

    01/01/2022, 10:43 AM
    user voting db design
  • t

    TremalJack

    01/01/2022, 3:38 PM
    Hello guys, I started a new discussion about the possibility to send a custom header paramenter using supabase-js https://github.com/supabase/supabase/discussions/4755 If anyone have some solutions, ideas, or want contribute on the conversation please partecipate ❤️
  • d

    DevilsBlade0

    01/02/2022, 4:01 PM
    Hi Guys, 2 questions please. 1. I’m using NextJs and all the tutorials online are fetching and manipulating data on client side, even validating user auth, is this the right approach (considering it’s used on the official todo example on supabase docs) 2. I’m already using tailwind NextJs, but I like the Auth component from supabase ui and how easy it is to implement, is adding supabase ui a good practice after I fully installed tailwind ? In terms of bundle size and speeds. I only want certain components and not the full ui experience Thank you 🙏🏽
    b
    • 2
    • 2
  • b

    beru

    01/03/2022, 4:19 AM
    nextjs with supabase
  • s

    Stuart

    01/03/2022, 2:10 PM
    HI Guys with the supabase-js library the docs show this example. Is this possible with typescript, when I try and access a column of a sub table, in the example username on user I get a type error as that isn't a direct column?
  • s

    Scott P

    01/03/2022, 4:44 PM
    Is there a way to call an
    rpc()
    function with a parameter that's an array (that's mapped to a custom postgres
    enum[]
    )? (Details in thread)
    • 1
    • 2
  • m

    Mike92988

    01/03/2022, 8:16 PM
    Anybody have any suggestions on updating json arrays with the library? I can't seem to get it working at the moment and was wondering if anyone else had any luck
1...404142...81Latest