https://supabase.com/ logo
Join Discord
Powered by
# help
  • g

    garyaustin

    10/30/2021, 9:37 PM
    Are using hosted Supabase? I'm not familiar with your url as beyond my learnings so far but, https://supabase.io/docs/guides/database/connecting/connection-pooling Are using session or transaction? If you are on a paid plan you probably should contact support about the pgbouncer max client setting which you appear to be exceeding. If you are hosting yourself then check that setting.
  • k

    KrisCoulson

    10/30/2021, 9:44 PM
    Thanks @User I am on a paid plan and I have it set to
    transaction
    I might reach out. It was also suggested to me on another discord to try
    connection_limit=1
    appended to the db url. So I am going to give that a try aswell
  • p

    Prodigy7kX

    10/30/2021, 10:46 PM
    Hey yall, I'm using Angular to basically clone the Microsoft To do App, and I'm having some problems that i don't know exactly why. my issue: * Whenever I Login into my application I can't add any new task, it gives my this error:
    Copy code
    {
       code: "42501"
       details: null
       hint: null
       message: "new row violates row-level security policy for table \"tasks\""
    }
  • p

    Prodigy7kX

    10/30/2021, 10:47 PM
    It works fine if I refresh the page after I login
  • p

    Prodigy7kX

    10/30/2021, 10:48 PM
    thats the policy i have setup for the table
    (uid() = user_id)
  • p

    Prodigy7kX

    10/30/2021, 10:48 PM
    I'm happy to provide more details if anyone needs
  • v

    Vinzent

    10/30/2021, 11:18 PM
    did you set it for insert, update and select?
  • p

    Prodigy7kX

    10/30/2021, 11:21 PM
    yeah, for all
  • v

    Vinzent

    10/30/2021, 11:22 PM
    and it works after you refresh the page? Then maybe you're not authenticated on your api call?
  • p

    Prodigy7kX

    10/30/2021, 11:22 PM
    it only works if i refresh the page after i logged in
  • v

    Vinzent

    10/30/2021, 11:23 PM
    I have no clue of Angular, but I suggest you to check your header to check that you are sending the right auth header
  • p

    Prodigy7kX

    10/30/2021, 11:24 PM
    will do so
  • p

    Prodigy7kX

    10/30/2021, 11:31 PM
    For what I've seen the headers are the same for both the request, the one that doesn't work and the one that does
  • v

    Vinzent

    10/30/2021, 11:33 PM
    Hmm then I don't know sorry
  • p

    Prodigy7kX

    10/30/2021, 11:33 PM
    no worries
  • p

    Prodigy7kX

    10/30/2021, 11:33 PM
    thanks for your time tho
  • v

    VuNguyen

    10/31/2021, 1:41 AM
    How can I ignore rows that contains non-exist foreign key using upsert?
  • v

    VuNguyen

    10/31/2021, 8:21 AM
    Text search for object ?
    • 1
    • 2
  • s

    sockenguy

    10/31/2021, 3:43 PM
    Does it make sense to use Prisma, if I already use supabase?
  • k

    KrisCoulson

    10/31/2021, 4:33 PM
    @User that is seems like it is your preference do you like how you query the database with Prisma? Might be a little bit easier if you don't know sql syntax
  • s

    sockenguy

    10/31/2021, 5:12 PM
    currently I just have simple crud operations, but I would like to learn prisma aswell, since my currently project is only a private project I can test out a few things. But it wouldn't be redundant or bad in a way to use prisma with supabase right?
  • s

    sockenguy

    10/31/2021, 5:12 PM
    I would like to work with a type ORM primarly
  • k

    KrisCoulson

    10/31/2021, 5:18 PM
    @User no I run my app using redwoodjs and use prisma to communicate with my database. Its not redundant just gives me good/preferred way to communicate with my db.
  • a

    AirDiamond

    10/31/2021, 6:12 PM
    Can someone tell me what I'm doing wrong in this function? The goal is to set the value of a field based on a string match in another field. But I'm getting the error, "location.region" is not a known variable". Bonus points for letting me know where I can see the output of RAISE EXCEPTION. I'm new to this all, in case that isn't obvious. 🙂 CREATE OR REPLACE FUNCTION setRegion() RETURNS trigger AS $$ BEGIN IF NEW.location.address LIKE '%Truckee%' THEN -- RAISE EXCEPTION 'truckee'; location.region := "Truckee"; ELSE -- RAISE EXCEPTION 'tahoe'; location.region := "Tahoe"; END IF; RETURN null; END; $$ LANGUAGE plpgsql;
  • g

    garyaustin

    10/31/2021, 6:38 PM
    You might look here https://www.postgresql.org/docs/13/plpgsql-trigger.html for an example of what I think you are trying to do. Not sure you get to see the exception from a trigger in the final return, but it should fail.
  • a

    AirDiamond

    10/31/2021, 6:40 PM
    Thank you, Gary. That was actually the page I was looking at when I wrote the code. I've tried every combination that I can think of (including using NEW.location.region) but it always returns the same error about whatever not being a known variable.
    g
    • 2
    • 11
  • d

    Decentralizer

    11/01/2021, 3:43 AM
    Hey guys, For the past 7 days I’ve been painstakingly trying to find out why my expo app wasn’t compiling after upgrading to sdk43. Turns out
    supabase-js
    is the culprit. https://github.com/supabase/supabase-js/issues/295 If anyone has any insight on how to move forward please let me know.
    s
    • 2
    • 3
  • s

    Scott P

    11/01/2021, 4:41 AM
    [GH issue 295] Supabase breaking React Native and Expo apps
  • v

    VuNguyen

    11/01/2021, 8:13 AM
    Why when I use
    .range(0, 30)
    , it query the api with
    offset=0
    and
    limit=31
    ?
  • v

    VuNguyen

    11/01/2021, 9:05 AM
    Can someone please explain? I got two duplicate items from this two query
1...123124125...316Latest