https://supabase.com/ logo
Join DiscordCommunities
Powered by
# python
  • u

    user

    11/08/2021, 10:56 AM
    is there a way to pass RLS using python?
  • u

    user

    11/08/2021, 10:56 AM
    @User
  • s

    silentworks

    11/08/2021, 12:32 PM
    @User please don't at Team in the channel, just ask and someone will answer, the python library is community developed
  • u

    user

    11/08/2021, 2:23 PM
    sorry
  • n

    nikolatesla13

    11/09/2021, 7:28 PM
    hello, I can't figure out how to update a row from the database using python from the docs, this is my code:
    Copy code
    py
    supabase.from_("users").eq("id", user["id"]).update({"files": filesAlreadyUploaded["files"].append(fileUploaded["id"])}).execute()
    and the error is
    AttributeError: 'RequestBuilder' object has no attribute 'eq'
  • n

    nikolatesla13

    11/09/2021, 7:30 PM
    also if I change the code to
    Copy code
    py
    supabase.table("users").select("*").eq("id", user["id"]).update({"files": filesAlreadyUploaded["files"].append(fileUploaded["id"])}).execute()
    I get this error:
    AttributeError: 'SelectRequestBuilder' object has no attribute 'update'
  • p

    pedrodiaz

    11/09/2021, 8:08 PM
    Hello
  • p

    pedrodiaz

    11/09/2021, 8:10 PM
    Try with something like this:
    Copy code
    py
    supabase.table("users").update(
       { 'name': 'Auckland' }, # Selection/Target column
       { 'name': 'Middle Earth' } # Update
    )
  • p

    pedrodiaz

    11/09/2021, 8:10 PM
    example from: https://keosariel.github.io/2021/08/08/supabase-client-python/
  • n

    nikolatesla13

    11/09/2021, 8:12 PM
    I get
    TypeError: 'SelectRequestBuilder' object is not subscriptable
  • n

    nikolatesla13

    11/09/2021, 8:15 PM
    does it have something to do with not being async?
  • p

    pedrodiaz

    11/09/2021, 8:16 PM
    It's because you're using a select statement
  • p

    pedrodiaz

    11/09/2021, 8:18 PM
    What does this is just a request to the database to select the rows with equal id
    Copy code
    py
    supabase.table("users").select("*").eq("id", user["id"])
  • p

    pedrodiaz

    11/09/2021, 8:18 PM
    is not an object with a .update method
  • p

    pedrodiaz

    11/09/2021, 8:18 PM
    can I see your request, please?
  • a

    anand

    11/10/2021, 3:14 AM
    i believe the
    .eq
    filter has to be applied after the `.update`; there's an error in the examples
  • n

    nikolatesla13

    11/10/2021, 2:31 PM
    now I have
    TypeError: update() takes 2 positional arguments but 3 were given
  • n

    nikolatesla13

    11/10/2021, 2:32 PM
    Copy code
    py
    supabase.table("users").update({"id": user["id"]}, {"files": files})
  • a

    anand

    11/11/2021, 7:48 AM
    i already answered this above? the .eq has to come after the .update
    Copy code
    py
    supabase.table("users").update({"files": files}).eq("id", user["id"])
  • n

    nikolatesla13

    11/11/2021, 8:10 AM
    Doesn't work
  • n

    nikolatesla13

    11/11/2021, 8:11 AM
    It can't find eq
  • a

    anand

    11/11/2021, 8:31 AM
    "can't find"? can you elaborate?
  • s

    SOSA

    11/15/2021, 10:23 PM
    Apologies if this has been answered before, but I am unable to compile my python script using PyInstaller when
    import supabase
    is called
  • s

    SOSA

    11/15/2021, 10:24 PM
    It happens only when I am importing supabase, with the error
    IndexError: tuple index out of range
  • a

    anand

    11/16/2021, 4:08 AM
    Odd
  • a

    anand

    11/16/2021, 4:08 AM
    Can you send the entire traceback?
  • s

    SOSA

    11/16/2021, 7:11 AM
    So I ended up fixing it. Turns out it’s a Python bug that handles certain packages incorrectly. it’s fixed in 3.11
  • a

    anand

    11/16/2021, 7:11 AM
    Cool 👍
  • l

    leynier

    11/18/2021, 9:18 PM
    @User I think that adding codecov.io to repositories for automatic coverage reports in pull requests will be good. What do you think?
  • l

    leynier

    11/18/2021, 9:19 PM
    This will encourage us to try to increase the coverage in each pull request.
1...789...19Latest