Episode 74: PostgreSQL with PGX in Go: Step-by-Step Tutorial

FREE

Instructor: Amrit Pal SinghLanguage: English

About the episode

In this episode, we dive deep into the pgx package, one of the most powerful PostgreSQL drivers and toolkits for Go developers. Whether you're just starting with PostgreSQL in Go or looking to level up your database skills, this episode has got you covered.  

Here's what you'll learn:  
✅ How to set up and connect to a PostgreSQL database using pgx  
✅ The difference between single connections and connection pooling  
✅ How to perform INSERT, SELECT, UPDATE, and DELETE operations  
✅ Managing transactions effectively to ensure data integrity  
✅ Querying multiple rows and mapping them to Go structs  
✅ Handling advanced features like parameterized queries and error handling  

By the end of this video, you’ll have a solid understanding of the pgx package and be ready to use it in your own Golang projects!  

💡 Don’t forget to like, comment, and subscribe for more Golang tutorials, and hit the 🔔 to stay updated on new videos.  

Timestamps:
00:00 Introduction  
00:41 Installing and Setting Up pgx  
00:51 Creating Tables 
01:24 Connection Pooling with pgx  
03:17 Insert Data into PostgreSQL  
04:07 Using Transactions with pgx  
05:51 Querying Multiple Rows  
08:03 Querying a Single Row  
08:55 Updating Records  
09:48 Deleting Records  
10:32 Wrap-Up  

📚 Resources:  
- 📝 Source code: https://github.com/code-heim/go_74_pgx
- PGX Documentation: https://github.com/jackc/pgx

Thanks for watching, and see you in the next episode! 🚀