Use AI to enable and generate RLS policies for Postgres with Supabase

แชร์
ฝัง
  • เผยแพร่เมื่อ 28 พ.ย. 2024

ความคิดเห็น • 55

  • @Supabase
    @Supabase  11 หลายเดือนก่อน +12

    This is just the first announcement of Supabase Launch Week X.
    Read the blog post here: supabase.com/blog/studio-introducing-assistant?

    • @Supabase
      @Supabase  11 หลายเดือนก่อน +2

      And more Launch week announcements here: supabase.com/launch-week?

    • @awalias
      @awalias 11 หลายเดือนก่อน

      @@Supabase spicy

    • @codooze
      @codooze 11 หลายเดือนก่อน

      I didn't know we could also impersonate users from Supabase, that's a huge help. Also pls a video about creating customs roles, and how they relate to auth.users if there is any relation, because I don't know if we should be modifying that.

    • @DarrylChangHeathcote
      @DarrylChangHeathcote 6 หลายเดือนก่อน +1

      my UI does not match the UI in this video. Not sure if this version of Supabase is outdated?

  • @adam_ordway
    @adam_ordway 11 หลายเดือนก่อน +28

    This is great! I really like the impersonation feature. It’s always a pain to test different levels of access.

    • @JonMeyers
      @JonMeyers 11 หลายเดือนก่อน +5

      Yeah, I agree! This is going to save me so much time! 🎉

    • @awalias
      @awalias 11 หลายเดือนก่อน

      @@JonMeyers the kinda thing you don't realize how much it was missing until it's there!

  • @dshukertjr
    @dshukertjr 11 หลายเดือนก่อน +8

    I was just playing around with user impersonation, and wow it's easy to use and powerful.

    • @awalias
      @awalias 11 หลายเดือนก่อน

      Yeah I honestly love this feature!

  • @yarapolana
    @yarapolana 11 หลายเดือนก่อน +10

    OMGGGGG I literally suggested this on Twitter/X, I had no clue you were actually implementing it.

  • @Flopshoubox
    @Flopshoubox 11 หลายเดือนก่อน +12

    Those impersonate tool and ai assitant are damn good ! Makes me want to deep dive on RLS !

    • @JonMeyers
      @JonMeyers 11 หลายเดือนก่อน +2

      Yeah, it’s going to save me so much time! 🚀

  • @thorwebdev
    @thorwebdev 11 หลายเดือนก่อน +3

    This is awesome, the Supabase Dashboard is becoming so incredibly powerful 🙌

  • @BretMogilefsky
    @BretMogilefsky 11 หลายเดือนก่อน +8

    Terrific stuff, very well presented. Thanks!

  • @eleah2665
    @eleah2665 11 หลายเดือนก่อน +4

    Jon is here!

    • @JonMeyers
      @JonMeyers 11 หลายเดือนก่อน +2

      Let’s get into it!

  • @emergingbits
    @emergingbits 11 หลายเดือนก่อน +7

    This is great. Thanks for the hard work! I also find defining functions a bit jarring as a new user. For instance to inserting multiple records relational queries is a common use case that's not that easy to do out of the box. An AI tool for functions and some advanced examples with `plpgsql` or how to properly use sql in functions would be greatly appreciated. Or an alternative would be to provide the supabase sdk to allow for nested inserts (for relational queries) would be a huge unlock (like it's possible with Prisma if you google: Prisma Relational Queries: Nested Writes)

    • @JonMeyers
      @JonMeyers 11 หลายเดือนก่อน +2

      Great feedback! 🙌 Supabase AI is also available in the SQL Editor so it can help you write your Postgres functions. I am also putting together a bunch of Postgres theory content for next year so will make sure all of this is covered!

  • @davebenjamin4388
    @davebenjamin4388 11 หลายเดือนก่อน +4

    Awesome but when will it be available for local Dev, which is where we really need this?

  • @ricardocnn
    @ricardocnn 11 หลายเดือนก่อน +8

    Awesome video!

    • @JonMeyers
      @JonMeyers 11 หลายเดือนก่อน +1

      Thanks! 🙌 Glad you enjoyed it! What do you want to see next?

    • @ricardocnn
      @ricardocnn 11 หลายเดือนก่อน

      @@JonMeyers RLS also set a limit of registers?

  • @darkbacon2630
    @darkbacon2630 11 หลายเดือนก่อน +8

    awesome feature 🤙

    • @JonMeyers
      @JonMeyers 11 หลายเดือนก่อน +1

      It’s one of my favourites so far! 🚀

  • @frnk_snslvdr
    @frnk_snslvdr 11 หลายเดือนก่อน +2

    User Impersonation: brilliant

  • @dnlmgwi
    @dnlmgwi 11 หลายเดือนก่อน +8

    Love This!

    • @JonMeyers
      @JonMeyers 11 หลายเดือนก่อน +2

      Glad you enjoyed it! 🙌 Much more coming over the next few days!

  • @jimvh7557
    @jimvh7557 3 หลายเดือนก่อน +1

    Apparently: Supabase introduced a feature that used AI to generate Row Level Security (RLS) policies at the beginning of 2024. However, this feature is no longer available. The removal may be related to several challenges and limitations associated with RLS policies and their implementation.
    RLS policies in Supabase can become complex and challenging to manage, especially when dealing with performance issues and maintaining consistency across different parts of the application. There have been reports of difficulties in testing and debugging these policies, as well as issues with maintaining a good developer experience  .
    Additionally, there are specific technical hurdles related to RLS, such as the need for duplicating policy filters in application code and ensuring that policies are correctly applied without impacting performance .
    Given these complexities, it’s possible that Supabase decided to remove the AI-generated RLS policy feature to focus on more stable and manageable solutions. For current best practices on implementing RLS in Supabase, you can refer to their official documentation.

    • @sokrates297
      @sokrates297 3 หลายเดือนก่อน

      I've been struggling so hard just to implement a simple insert, select, update, and delete. It's crazy there's no default RLS with just applied "authenticated" using "true", and it working out of the box. I've never seen such "secure"/tied down system to a sql database before.

  • @farow610
    @farow610 11 หลายเดือนก่อน +2

    The impersonation feature only works with supabase auth and not next-auth, correct ? Also, the ai assistant is so cool but does it have hallucinations like Chatgpt ?

    • @JonMeyers
      @JonMeyers 11 หลายเดือนก่อน

      I haven't played with next-auth for a while, but if it doesn't enforce regular RLS policies, then the impersonation feature won't match what a user in next-auth would get back. Also, I don't think next-auth uses the auth.users table so your next-auth users will probably not show up under the impersonation tab - again, haven't tested this so it might work perfectly! 🙂
      We recommend checking the AI suggestion is what you want to do before running the SQL, as it may get a little "creative" 👍

  • @coleblender
    @coleblender 5 หลายเดือนก่อน

    I use DrizzleORM and connect to my DB with a connection string. I have enabled RLS and haven't created a policy but I'm still able to query the data on my website. Why is this?

  • @andreasfun9591
    @andreasfun9591 5 หลายเดือนก่อน

    Hi there! Thanks for the vid. I am having trouble using Supabase with Buildship. Even when I enable RLS, use a policy I get null. I disable RLS, I still get null. These happen both for using anon key and the service role secret key.. Do you have any idea why this is happening and how to fix it?

  • @gustavomonteiro2008
    @gustavomonteiro2008 3 หลายเดือนก่อน

    My question IS : How to insert a Record that has is_published set to false? Never understood why The selected policy always run after an update. It reduces so much the Power of this approach

  • @2an_sound
    @2an_sound 10 หลายเดือนก่อน +1

    Why is your UI for creating a new policy so different from mine? When I click New Policy it brings up the modal with templates or from scratch options.

    • @chychywoohoo
      @chychywoohoo 10 หลายเดือนก่อน +1

      Same for me. This video seems to be outdated

  • @mahdiboughanmi6781
    @mahdiboughanmi6781 6 หลายเดือนก่อน

    am new to supabase and postgres , while i loved it at first i hated rls for more complicated schemas
    like for exp user owns a store and a store has its own categories
    how do i write a policy for only store owners can add categories when they don't have direct relationship

  • @din2
    @din2 11 หลายเดือนก่อน

    How to make page views with NextJs and Supabase?

  • @ricardocnn
    @ricardocnn 11 หลายเดือนก่อน

    I don't have this feature.

  • @1gouravgg
    @1gouravgg 11 หลายเดือนก่อน +1

    is there really a need to enable RLS if I access db only via backend?

    • @pearceodegard582
      @pearceodegard582 11 หลายเดือนก่อน

      What if someone attempts to access your database API directly if they get ahold of the URL?

    • @thorwebdev
      @thorwebdev 11 หลายเดือนก่อน +1

      If you don’t expose your anon key it’s fine. But better be safe than sorry!

  • @onedayapp3534
    @onedayapp3534 5 หลายเดือนก่อน

    I cant see the AI chat on policies

  • @0xbinarylol
    @0xbinarylol 6 หลายเดือนก่อน

    Enabling RLS strict live changes

  • @schlep
    @schlep 11 หลายเดือนก่อน

    🤖🚀🚀

  • @supa_olirice
    @supa_olirice 11 หลายเดือนก่อน

    🚀

  • @RajeshNeupane-j3u
    @RajeshNeupane-j3u 3 หลายเดือนก่อน

    Could you please stop shaking your body. It's distracting from what you're saying!

  • @souravhazari4983
    @souravhazari4983 11 หลายเดือนก่อน

    Through RLS I have acheive user_permission design. With this I can control which user can select, insert and update or delete from a table's boolean value ,,user wise row.

  • @HijabiCoder
    @HijabiCoder 11 หลายเดือนก่อน +6

    🔥 🆇

    • @JonMeyers
      @JonMeyers 11 หลายเดือนก่อน +4

      4 more to go! Plus all those other one more things! 😆

    • @Supabase
      @Supabase  11 หลายเดือนก่อน +3

      There's always one more thing(s)

  • @rodrigomansuelinunes1285
    @rodrigomansuelinunes1285 11 หลายเดือนก่อน +2

    Great video!