Database Query Basics with Flutter and Supabase
ฝัง
- เผยแพร่เมื่อ 9 ก.ย. 2024
- Supabase is a backend-as-a-service that allows you to spin up a serverless Postgres database with APIs in minutes. In this video, we are taking a look at the basics of how you can interact with your Supabase database via the REST API interface.
👇Links you need:👇
supabase_flutter package: pub.dev/packag...
Supabase quick starter guide for Flutter: supabase.com/d...
Official Supabase docs for Flutter: supabase.com/d...
Today, we're showing you how you can seamlessly interact with your Supabase database using REST API endpoints in your Flutter app.
One of the reasons developers choose Supabase, is that Supabase simplifies backend development by providing a serverless Postgres database that you can interact with through APIs, speeding up your app development process.
What you'll learn:
✅ Postgres Naming Conventions : get some handy tips on using snake_case for naming elements in your database to avoid complications in SQL queries.
✅ Insert Operations: Learn useful techniques for inserting data efficiently-whether a single row or in bulk-and how to leverage default values, particularly using auth.
uid for automatic user ID insertion.
✅ Select Queries: We'll show you some SUPER quick methods to fetch data effectively, customize column selection, and handle related data across tables without direct interaction with join tables.
✅ Applying Filters and Modifiers: Make your queries more precise with filters and use modifiers like limit, range, and order to refine results.
✅ Data Counting and Aggregation: We'll show you how to count rows and aggregate data, which as you'll know is a MUST for pagination and summarizing information in your applications.
If you're a developer looking to use Supabase for backend management with a Flutter frontend, you've come to the right tutorial video.
By the end of this video, you’ll be able to manage database operations WAY EASIER, ensuring robust backend interactions for your applications.
Don’t forget to subscribe for more practical tutorials on using Supabase with Flutter, and join our community on Discord to connect with other developers!
💻 Videos to watch next:
▶ Watch ALL Supabase & Flutter videos; • Flutter with Supabase
▶ Content recommendation app with OpenAI, Supabase, and Flutter: • Content recommendation...
▶ Install Google sign-in with Flutter: • How to implement Googl...
👇 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...
💬 Discord: www.discord.su...
🐦 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
We need more Flutter tutorials!!! This tutorial was mind blowing!!!!! GREAT WORK. 🥳🥳🥳🥳🥳🥳🥳🥳🥳🥳🥳🥳🥳🥳🥳🥳🥳🥳🥳🥳🥳🥳🥳🥳
I loved the video, supabase is incredible, I hope many videos like this reach the community and every day there are many more!!!
I didn't know about maybeSingle. I ended up removing single and checking the result length. Will try that out. Also it wasn't clear when you get a response object or a list of maps. This video helped.
please increase the frequency for flutter videos
Thanks for the huge support!
this content is a BEAST , I say
Great content! ❤❤❤❤
We need more please
how to setting auth.uid?what use extensions?
I wonder if we can add row level security only for few columns in our table. For example there is a table with user_id inside and I wanna allow owner to change everything except user_id inside this table.
In your particular case, you can set a `user_id = auth.uid()` update policy to enforce that the user cannot change the user_id value.
very helpful
Hey there can anyone tell me what type should i use to pass whole supabase row as a parameter in flutter as i cannot see postgresRow but i can see postgresColumn! Thanks it urgent!
Great, I wonder if it's possible to utilise others too like count.
Eg. table(count) gives the number of rows
Is there a way I can get the sum or avg of a specific column in table using any query like above?
Yup, you can perform aggregate functions with Supabase. Take a look at this blog article: supabase.com/blog/postgrest-aggregate-functions
Nice video! but how do I delete data automatically? i.e when a profile is deleted, all associated posts should also be deleted.
This is done with a constraint. Search cascade delete posrgresql
As @Ruby Learner has suggested, you can use the `on delete cascade` keyword to create your tables. This Stack Overflow answer might help! stackoverflow.com/questions/69251891/delete-associated-records-in-supabase
how to get only the rows which are added today
Supabase sucks at jwt custom authentication when coming to real-time data changes 😔
also make a video on different auth and error/exception handling with flutter.
i spend whole day to figure out that the sign in throws exception if credentials are incorrect and have to use a try-catch block to find it.
In the documentation there is no info on how to handle these exceptions (for a beginner like me(who is developing for the first time) that would be helpful
Thanks for the suggestion, and sorry for not making it as straight forward as we could have with the error handling. We will make sure to improve the docs around error handling, and also create a full video on auth!
Can you please make an explanation about storing the session in the most secure way and how we can increase the security of the database more than login authentication
We will create a video on auth with Flutter, but until then you can read this guide on how you can secure your database! supabase.com/docs/guides/auth/row-level-security