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

  Рет қаралды 8,564

Supabase

Supabase

Күн бұрын

This is your step-by-step guide to enabling and testing RLS (Row Level Security) in Supabase.
Day 1 - Supabase Studio Updates: AI Assistant, User Impersonation, and more: supabase.com/blog/studio-intr...
Row Level Security (RLS) is a super powerful way to implement authorization directly in your PostgreSQL database! In this video, Jon explains what RLS is and how to use AI to write policies from a simple text input! 🤖
In this new Supabase tutorial, we’re talking about security features in Supabase, specifically Row Level Security (RLS) in Postgres and Supabase. Watch as Jon demonstrates how it empowers you to implement robust authorisation directly within your database. Forget about complex back-end logic for data filtering-RLS does it seamlessly for you!
What you'll learn:
✅ Understanding RLS: Learn the basics of RLS and why you need it. It’s a powerful feature in Postgres that allows you to enforce data access controls directly at the database level.
✅ Setting Up RLS in Supabase: Learn how to activate RLS from the Supabase dashboard or via SQL commands to enhance your app's security.
✅ Crafting RLS Policies with AI: Utilise Supabase AI to generate and refine security policies, making the setup process less intimidating and more accessible.
✅ Testing RLS Policies: See how to test these policies for specific user scenarios to ensure they perform as expected.
✅ Practical Demonstration: Follow a step-by-step guide to creating and applying RLS policies to a blog post table, ensuring that only published posts are visible to users.
After watching this video, you'll be able to:
✅ Configure RLS on your tables confidently with Supabase.
✅ Write and apply selective access policies that enhance the security and usability of your applications.
✅ Utilise AI tools to simplify the creation and management of security policies.
Don’t let the backend logistics scare you away; with Supabase’s RLS and AI tools, setting up database security is straightforward and really quick. If you want to handle authorisation in Supabase - watch this!
More Launch Week 🆇: supabase.com/launch-week?utm_...
CHAPTERS:
0:00 What you'll learn!
0:16 What is RLS (Row Level Security)
0:28 Example of RLS policy on site
0:58 Enabling RLS in Supabase
1:48 Empty array troubleshooting
2:04 Enabling RLS in Supabase and troubleshooting tips
4:44 Authenticating users
💻 Videos to watch next:
▶ Watch ALL Postgres/Supabase videos: • Learn Postgres
▶ Implement Authorization using Row Level Security with Supabase
: • Implement Authorizatio...
▶ Supabase is now GA: • Supabase is now GA
👇 Learn more about Supabase 👇
🕸 Website: supabase.com/
🏁 Get started: app.supabase.com/
📄 Docs: supabase.com/docs
🔔 Subscribe for more tutorials and feature updates from Supabase: / @supabase
📱 Connect with Us:
🐙 Github: www.github.com/supabase
💬 Discord: www.discord.supabase.com/
🐦 Twitter: / supabase
▶ Instagram (follow for memes): / supabasecom
ABOUT SUPABASE:
Supabase is the open source Firebase alternative. Supabase provides a full Postgres database for every project with pgvector, backups, realtime, and more. Add and manage email and password, passwordless, OAuth, and mobile logins to your project through a suite of identity providers and APIs.
Build in a weekend, scale to millions.
#Supabase #AppDevelopment #RealtimeApps #DeveloperTools

Пікірлер: 48
@Supabase
@Supabase 5 ай бұрын
This is just the first announcement of Supabase Launch Week X. Read the blog post here: supabase.com/blog/studio-introducing-assistant?
@Supabase
@Supabase 5 ай бұрын
And more Launch week announcements here: supabase.com/launch-week?
@awalias
@awalias 5 ай бұрын
@@Supabase spicy
@codooze
@codooze 5 ай бұрын
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 21 күн бұрын
my UI does not match the UI in this video. Not sure if this version of Supabase is outdated?
@adamordway4548
@adamordway4548 5 ай бұрын
This is great! I really like the impersonation feature. It’s always a pain to test different levels of access.
@JonMeyers
@JonMeyers 5 ай бұрын
Yeah, I agree! This is going to save me so much time! 🎉
@awalias
@awalias 5 ай бұрын
@@JonMeyers the kinda thing you don't realize how much it was missing until it's there!
@yarapolana
@yarapolana 5 ай бұрын
OMGGGGG I literally suggested this on Twitter/X, I had no clue you were actually implementing it.
@dshukertjr
@dshukertjr 5 ай бұрын
I was just playing around with user impersonation, and wow it's easy to use and powerful.
@awalias
@awalias 5 ай бұрын
Yeah I honestly love this feature!
@Flopshoubox
@Flopshoubox 5 ай бұрын
Those impersonate tool and ai assitant are damn good ! Makes me want to deep dive on RLS !
@JonMeyers
@JonMeyers 5 ай бұрын
Yeah, it’s going to save me so much time! 🚀
@BretMogilefsky
@BretMogilefsky 5 ай бұрын
Terrific stuff, very well presented. Thanks!
@thorwebdev
@thorwebdev 5 ай бұрын
This is awesome, the Supabase Dashboard is becoming so incredibly powerful 🙌
@dnlmgwi
@dnlmgwi 5 ай бұрын
Love This!
@JonMeyers
@JonMeyers 5 ай бұрын
Glad you enjoyed it! 🙌 Much more coming over the next few days!
@ricardocnn
@ricardocnn 5 ай бұрын
Awesome video!
@JonMeyers
@JonMeyers 5 ай бұрын
Thanks! 🙌 Glad you enjoyed it! What do you want to see next?
@ricardocnn
@ricardocnn 5 ай бұрын
@@JonMeyers RLS also set a limit of registers?
@darkbacon2630
@darkbacon2630 5 ай бұрын
awesome feature 🤙
@JonMeyers
@JonMeyers 5 ай бұрын
It’s one of my favourites so far! 🚀
@eleah2665
@eleah2665 5 ай бұрын
Jon is here!
@JonMeyers
@JonMeyers 5 ай бұрын
Let’s get into it!
@emergingbits
@emergingbits 5 ай бұрын
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 5 ай бұрын
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 5 ай бұрын
Awesome but when will it be available for local Dev, which is where we really need this?
@frnk_snslvdr
@frnk_snslvdr 5 ай бұрын
User Impersonation: brilliant
@rodrigomansuelinunes1285
@rodrigomansuelinunes1285 5 ай бұрын
Great video!
@farow610
@farow610 5 ай бұрын
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 5 ай бұрын
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" 👍
@2an_sound
@2an_sound 4 ай бұрын
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 4 ай бұрын
Same for me. This video seems to be outdated
@mahdiboughanmi6781
@mahdiboughanmi6781 Ай бұрын
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
@1gouravgg
@1gouravgg 5 ай бұрын
is there really a need to enable RLS if I access db only via backend?
@pearceodegard582
@pearceodegard582 5 ай бұрын
What if someone attempts to access your database API directly if they get ahold of the URL?
@thorwebdev
@thorwebdev 5 ай бұрын
If you don’t expose your anon key it’s fine. But better be safe than sorry!
@ricardocnn
@ricardocnn 5 ай бұрын
I don't have this feature.
@din2
@din2 5 ай бұрын
How to make page views with NextJs and Supabase?
@sonuaryan5287
@sonuaryan5287 8 күн бұрын
Enabling RLS strict live changes
@supa_olirice
@supa_olirice 5 ай бұрын
🚀
@schlep
@schlep 5 ай бұрын
🤖🚀🚀
@souravhazari4983
@souravhazari4983 5 ай бұрын
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 5 ай бұрын
🔥 🆇
@JonMeyers
@JonMeyers 5 ай бұрын
4 more to go! Plus all those other one more things! 😆
@Supabase
@Supabase 5 ай бұрын
There's always one more thing(s)
Create PostgreSQL Functions with Supabase
11:58
Supabase
Рет қаралды 34 М.
it takes two to tango 💃🏻🕺🏻
00:18
Zach King
Рет қаралды 32 МЛН
Can you beat this impossible game?
00:13
LOL
Рет қаралды 49 МЛН
ПООСТЕРЕГИСЬ🙊🙊🙊
00:39
Chapitosiki
Рет қаралды 16 МЛН
CAN YOU HELP ME? (ROAD TO 100 MLN!) #shorts
00:26
PANDA BOI
Рет қаралды 36 МЛН
3 reasons you should use Postgres Functions and Transactions
16:58
Supabase just shipped a LOT of cool stuff...
15:31
Ben Davis - Tech
Рет қаралды 2,9 М.
Solving one of PostgreSQL's biggest weaknesses.
17:12
Dreams of Code
Рет қаралды 172 М.
This VS Code AI Coding Assistant Is A Game Changer!
14:27
codeSTACKr
Рет қаралды 129 М.
Usage-based restrictions for SaaS subscription tiers
35:28
Supabase
Рет қаралды 6 М.
8 things you should NEVER do in a Database!
22:56
Supabase
Рет қаралды 8 М.
Rust's Alien Data Types 👽 Box, Rc, Arc
11:54
Code to the Moon
Рет қаралды 132 М.
Fetching Data Doesn't Get Better Than This
6:58
Josh tried coding
Рет қаралды 61 М.
Is Supabase Legit? Firebase Alternative Breakdown
8:16
Fireship
Рет қаралды 343 М.
Nokia 3310 versus Red Hot Ball
0:37
PressTube
Рет қаралды 3,8 МЛН
iPhone 12 socket cleaning #fixit
0:30
Tamar DB (mt)
Рет қаралды 15 МЛН
Apple watch hidden camera
0:34
_vector_
Рет қаралды 54 МЛН
POCO F6 PRO - ЛУЧШИЙ POCO НА ДАННЫЙ МОМЕНТ!
18:51
Mi primera placa con dios
0:12
Eyal mewing
Рет қаралды 497 М.