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

    Geoffrey

    12/11/2021, 9:19 PM
    I understand the whole mechanism of setting the cookie, using the cookie in getServerSideProps etc, but I just can manage to make it work on the
    /
    path
  • m

    Maximilian

    12/11/2021, 10:47 PM
    Hey, how is it going? Quick question: I just tried to update my table to use realtime and rls but my client doesn't receive events despite the "everyone can read" policy. Is there anything I am missing?
    g
    • 2
    • 13
  • g

    garyaustin

    12/11/2021, 11:04 PM
    realtime and RLS
  • t

    ThirdBase

    12/12/2021, 2:03 AM
    Maybe I'm misunderstanding something or missing something obvious, but I can't get my avatar bucket files to update using from.update(). A new upload is fine, but when I use update using the same path/name I get a 404 error saying the resource not found. Here's my code between the two calls. Can anyone see what I'm doing wrong? Thanks!
    g
    • 2
    • 4
  • t

    ThirdBase

    12/12/2021, 2:23 AM
    Bucket API Help
  • c

    codesalim

    12/12/2021, 5:56 PM
    hello everyone, i want implement follow and following. How do i go about implementing it?
  • e

    Ethanxyz

    12/13/2021, 3:03 AM
    I am having trouble inserting an array into a text array
  • y

    YANN

    12/14/2021, 12:07 AM
    Hello, I have trouble understanding what is the difference between those 2 requests, could someone drop a link with the sql references or explain it here please ? Have a good day
    Copy code
    js
    await $core.db.from('persona').update({ model: 450 }).match({ id: 1 });
    await $core.db.from('persona').update({ model: 450 }).eq('id', 1);
  • g

    garyaustin

    12/14/2021, 1:13 AM
    The end result is the same for what you show. .match lets you have multiple columns as part of the object and uses an object. It is more a convenience thing as you don't need to build an object to use .eq on a single column.
  • y

    YANN

    12/14/2021, 1:14 AM
    I see, it's obvious said like that thank you
  • d

    DarrenJr

    12/14/2021, 10:33 PM
    For some reason i keep getting a 403 (forbidden error) when attempting to insert to supabase table. Anyone know why?
    s
    • 2
    • 1
  • s

    silentworks

    12/15/2021, 9:50 AM
    403 forbidden error
  • w

    wiesson

    12/15/2021, 7:21 PM
    https://supabase.com/docs/reference/javascript/or#use-or-with-and Could somebody explain this query to me?
    Copy code
    .or('id.gt.20,and(name.eq.New Zealand,name.eq.France)')
    Like this?
    Copy code
    ID > 20 OR (name = ‘New Zealand’ AND name = ’France’) ?
    Doesn't make sense to me that name could be New Zealand AND France (?)
  • j

    jensen

    12/15/2021, 7:26 PM
    Looks incorrect. I would expect it to be
    .and('id.gt.20, or(name.eq.New Zealand, name.eq.France'))
  • j

    jensen

    12/15/2021, 7:26 PM
    I have a fairy complex one here https://github.com/jensen/chatatat/blob/15d4933a649f5c4ed159ef6f1becb18b4a745605/src/routes/conversations/%24id/messages.tsx#L32
  • j

    jensen

    12/15/2021, 7:27 PM
    It's making sure a direct message was either from a to b or from b to a.
  • w

    wiesson

    12/15/2021, 7:28 PM
    Thanks! My use case is that I'd like to have all posts that are published and (a OR b) - I have RLS active, but as an admin I can see all posts 😉
  • j

    jensen

    12/15/2021, 7:30 PM
    ah yeah
  • j

    jensen

    12/15/2021, 7:30 PM
    that should work then..
  • w

    wiesson

    12/15/2021, 7:30 PM
    Like the other way around from the example, but the AND at the end confused me
  • w

    wiesson

    12/15/2021, 7:31 PM
    🌠 ed your repo btw 🙂
  • j

    jensen

    12/15/2021, 7:31 PM
    thanks! there are other examples in there as well
  • j

    jensen

    12/15/2021, 7:31 PM
    beeng trying out supbase for the past month or so
  • w

    wiesson

    12/15/2021, 7:39 PM
    Copy code
    from_id.eq.${u?.id}
    What happens if you query with
    undefined
    ? Will it skip the rule? (if u is not defined)
  • j

    jensen

    12/15/2021, 7:40 PM
    It won't find anything as far as I can tell
  • j

    jensen

    12/15/2021, 7:41 PM
    this was a hackathon rush job, so no error handling lol
  • j

    jensen

    12/15/2021, 7:41 PM
    but yeah, if u is undefined I expect it not to find the item
  • j

    jensen

    12/15/2021, 7:41 PM
    in that loader it should actually handle the error higher up if the user doesn't exist
  • w

    wiesson

    12/15/2021, 7:41 PM
    ok
  • w

    wiesson

    12/15/2021, 7:42 PM
    > .and('id.gt.20, or(name.eq.New Zealand, name.eq.France')) But there is not .and available 🤔
1...363738...81Latest