3 reasons you should use Postgres Functions and Transactions

Описание к видео 3 reasons you should use Postgres Functions and Transactions

Transactions allow related statements to be grouped together - ensuring every statement succeeds or they all get rolled back. In this video, Jon Meyers shows how to use PostgreSQL Functions to run multiple statements in a Transaction.

Learn Postgres playlist:    • Learn Postgres  

By wrapping the logic to keep the database consistent in a Postgres Function you can improve the security of your application, as the database is responsible for ensuring the data is correct. Additionally, this can improve the performance of your entire system as this Postgres Function only requires a single RPC network request to be invoked, rather than a web application sending each step of the transaction as a separate request.

📹 Full Next.js Email Client playlist:    • Build an Email Client with the Next.j...  
🧑‍💻 GitHub repo: https://github.com/dijonmusters/nextj...

00:00 Why you should use Postgres Functions and Transactions
00:36 What is a Transaction?
01:54 Overview of Email Client project
06:36 Runs multiple statements in a Transaction with Postgres Functions
11:02 Invoke Postgres Function from JavaScript using supabase-js and RPC
13:12 Using Cascade Deletes to remove related data from other tables
16:40 Implement an authorization system in PostgeSQL with Row Level Security policies

💻 Videos to watch next:
▶ Simplify complex SQL queries with Views in Postgres:    • Simplify complex SQL queries with Vie...  
▶ Fastest way to build a SaaS in 2024 - Next.js, Supabase and Stripe:    • Fastest way to build a SaaS in 2024 -...  
▶ Fastest way to get started with Next.js and Supabase in 2024:    • FASTEST way to get started with Next....  

👇 Learn more about Supabase 👇

🕸 Website: https://supabase.com/
🏁 Get started: https://app.supabase.com/
📄 Docs: https://supabase.com/docs

🔔 Subscribe for more tutorials and feature updates from Supabase:    / @supabase  

📱 Connect with Us:
🐙 Github: https://github.com/supabase
💬 Discord: https://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

Комментарии

Информация по комментариям в разработке