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

    Steve

    10/22/2021, 6:59 PM
    count error
  • m

    Maximous Black

    10/24/2021, 6:55 AM
    is there any better way to do this?
    Copy code
    ts
      let { data: Users, error } = query.search
        ? await supabase
            .from('User')
            .select('*')
            .ilike('username', `%${query.search}%`)
        : await supabase
            .from('User')
            .select('*')
    like any
    ILIKE
    query that matches all values?
  • m

    Maximous Black

    10/24/2021, 7:04 AM
    nevermind, got it
    Copy code
    ts
      let { data: Users, error } = await supabase
            .from('User')
            .select('*')
            .ilike('username', `%${query.search || ""}%`)
  • k

    kresimirgalic

    10/24/2021, 6:06 PM
    Hey guys, I have one problem with upload image, I added policies and upload went nicely, but when i want to show the image in img src, it says {"statusCode":"400","error":"TokenExpiredError","message":"jwt expired"}
  • g

    garyaustin

    10/24/2021, 6:54 PM
    When you call createSignedUrl how long are you setting the token to last?
  • k

    kresimirgalic

    10/24/2021, 6:55 PM
    30
    g
    • 2
    • 5
  • m

    minna

    10/25/2021, 4:41 PM
    Hello, please has anyone used Supabase for infinite scroll in react here ? I need help on implementing it
    g
    • 2
    • 3
  • g

    garyaustin

    10/25/2021, 6:07 PM
    Inifinite Scroll with React
  • t

    Tito

    10/26/2021, 2:38 PM
    Hi Folks... I got a strange behavior here:
    Copy code
    await this.$supabase
            .from("votes")
            .select("*").eq("project_id", this.project_id)
    returns an Array as expected... but If I try to count it, it returns none:
    Copy code
    await this.$supabase
            .from("votes")
            .select("*", { count: "exact", head: true }).eq("project_id", this.project_id)
    what am I doing wrong?
  • t

    Tito

    10/26/2021, 2:51 PM
    if I remove the "eq" from count it also works...
  • g

    garyaustin

    10/26/2021, 2:55 PM
    Remove head:true, that tells it to just return count.
  • t

    Tito

    10/26/2021, 2:58 PM
    I'd like just the count number... so with "head" I can't filter?
    g
    • 2
    • 6
  • m

    Mike92988

    10/26/2021, 9:19 PM
    Anybody have any suggestions on how to dynamically change pagination? for instance if the query param was something like ?page=1 I want to show the first pieces of data, and so forth, I'm just not entirely sure how to go about this with the library
  • g

    garyaustin

    10/26/2021, 9:28 PM
    I'm doing a paginated page right now. Basically you use .range(page x pagesize, page x pagesize + pagesize - 1) where page starts at 0. I use count return to generate a "paginator" in my case if more than 1 page worth.
  • m

    Mike92988

    10/26/2021, 9:41 PM
    sorry, I'm a bit of an idiot. but just to confirm, pagesize would be the total amount of result that you want on one page, correct?
    g
    • 2
    • 7
  • m

    Mike92988

    10/27/2021, 8:58 PM
    anybody have any suggestions on how to trigger a webhook when a specific column is updated in the DB?
  • y

    ymahmo

    10/28/2021, 12:37 PM
    Anyone on react native run into issues with joins data loading on the first load? Entire row is being read, but all of the joined information is returning null till I refresh. This is using a postgres function
  • y

    ymahmo

    10/28/2021, 12:38 PM
    or anyone using rpc's in general
  • y

    ymahmo

    10/28/2021, 12:54 PM
    ahhhh figured it out. Forgot to set read policies on the table i was joining on
  • m

    Mike92988

    10/28/2021, 7:04 PM
    I'm having some trouble with .neq() in my nodejs server, I'm trying to find all users except for a certain user type and I have the query set up with a couple of paramters in there, like a .eq(), and a .gt(), is there a specific order that I have to input these as or am I missing something?
  • m

    Mike92988

    10/29/2021, 12:04 AM
    can you use .select() to get multiple columns of data?
  • d

    dreinon

    10/29/2021, 2:00 AM
    yes
  • d

    dreinon

    10/29/2021, 2:01 AM
    If you just want columns of that table, then it's sql-like notation (comma-separated)
  • y

    yourfriend

    10/29/2021, 3:49 PM
    is there a way to do a
    SELECT FOR UPDATE
    with the client library?
  • y

    yourfriend

    10/29/2021, 4:02 PM
    was doing a bulk upsert and ran into (what i assume) was a lock contention issue (select and upsert statements locked up and timed out).
  • y

    yourfriend

    10/29/2021, 4:02 PM
    also does the free tier get throttled?
  • s

    spiderz

    10/31/2021, 1:47 AM
    The subscription is not working for me even though my syntax is correct. My code is as follows: let chatSubscription = supabase .from('messages') .on('*', payload => { console.log('Change received!', payload) }) .subscribe() Any ideas what I may be doing wrong? I do have the table replication on at Supabase.
  • t

    tamagoez

    10/31/2021, 2:18 AM
    How can I read rows on JavaScript? I'm not good at Javascript. I don't think this might help, but I will write my source code down.
    Copy code
    const username = async () => {
        return await supabase.from('users').select('username').eq('id', user?.id)
    }
    s
    • 2
    • 2
  • s

    silentworks

    10/31/2021, 2:30 AM
    Read rows in JavaScript
  • j

    jon

    11/01/2021, 5:16 PM
    Hey there, I'd like to do an or statement with fullText search. How do I go about this? Here's the documentation: https://supabase.io/docs/reference/javascript/or and its example:
    Copy code
    const { data, error } = await supabase
      .from('cities')
      .select('name, country_id')
      .or('id.gt.20,and(name.eq.New Zealand,name.eq.France)')
    if do:
    Copy code
    const { data, error } = await supabase
      .from('cities')
      .select('name, country_id')
      .or('fts_description.fullText.keyword,and(title.eq.New Zealand,name.eq.France)')
    I get:
    Copy code
    failed to parse logic tree
1...282930...81Latest