Explore this free video tutorial for Learning Golang: Relational Databases - Introduction to database/sql instructor Mario Carrion. This full video course has a total duration of 25:33 minutes providing step-by-step visual instructions. Access this full online lesson without any subscription or sign-up required.
Looking for comprehensive guides, code examples, or step-by-step walkthroughs for Learning Golang: Relational Databases - Introduction to database/sql? Our educational video hub aggregates top-rated learning materials to help you master new skills quickly. Check out related tutorials and recommended courses below TutorTube.
Course Description & Lesson Notes
Official Video Description:
Let's learn about accessing Relational Databases in Go/Golang using the standard library, specifically using "database/sql" and a concrete driver, which in this case is going to be "pgx".
This first episode introduces you to "database/sql" the default way to access Relational Databases in Go/Golang, I will cover the basic instructions to:
* Open a Connection using "sql.Open"
* Ping the connection using "db.PingContext" (also "db.Ping" works)
* Query one row using "db.QueryRowContext" (also "db.QueryRow" works)
* Query multiple rows using "db.QueryContext" (also "db.Query works)
* Inserting records using "db.ExecContext" (also "db.Exec" works)
This is the foundation of future videos that will come, also a few things to keep in mind regarding Relational Databases in Go/Golang:
* Go/Golang does not provide any official drivers, however it provides database/sql
* Typically drivers implement only that interface, but some like pgx add their own
* Nowadays we should be using the context-like methods when accessing databases
== Relevant links
* Example code: https://github.com/MarioCarrion/videos/tree/0e574a88b82ea18400ca525e01afd98d9f014e18/2021/11/17
* PostgreSQL driver and toolkit for Go: https://github.com/jackc/pgx
* Previous Episode: "Learning Golang: Functional Options / Default Configuration Values Pattern": https://youtu.be/fe8vJSIzWss
* "Software Architecture in Golang: Security - Databases, SQL Injection and Permissions" https://youtu.be/eixRIh80-F8
* "Learning Golang: Context package: Cancellations, Deadlines and Request-scoped values" https://youtu.be/mgJMIZsWfB4
== All Go/Golang video series covered
* Playlist "Learning Go": https://www.youtube.com/playlist?list=PL7yAAGMOat_F7bOImcjx4ZnCtfyNEqzCy
* Playlist "Software Architecture in Go": https://www.youtube.com/playlist?list=PL7yAAGMOat_GCd12Lrv_evJ3Zhv1dl8B-
* Playlist "Learning Go/Golang Concurrency Patterns" https://www.youtube.com/playlist?list=PL7yAAGMOat_Fhj_px_DzNzTsXs-mRwv1t
* Playlist "Building Microservices in Go": https://www.youtube.com/playlist?list=PL7yAAGMOat_Fn8sAXIk0WyBfK_sT1pohu
* Playlist "GoTools and Packages": https://www.youtube.com/playlist?list=PL7yAAGMOat_HEEOvH99agDs_5g51A0Ls3
* Playlist "Testing in Go": https://www.youtube.com/playlist?list=PL7yAAGMOat_HSeW4zF0uRL9EaHadE4ZZq
== Socials
* https://twitter.com/MarioCarrion
* https://www.instagram.com/mario.carrion
* https://linkedin.com/in/MarioCarrion
00:00 - Start
02:34 - Importing pgx for PostgreSQL in Golang
07:00 - Connecting to PostgreSQL using pgx in Golang
11:10 - Selecting row in PostgreSQL using pgx in Golang
15:20 - Inserting records in PostgreSQL using pgx in Golang
20:50 - Selecting multiple rows in PostgreSQL using pgx in Golang
24:40 - Conclusions
---
Who am I:
HelloππΌ! I'm Mario, a Hands-on Software Architect and Lead Backend Engineer with more than 16 years of professional experience building all kinds of software including on-premise Industrial Automation Systems, Linux Accessibility Desktop and Browser Components as well as Distributed Advertising Microservices.
Every week I will share with you different topics I've learned while working for small startups and large companies including the processes I've followed over the years for successfully delivering complex enterprise systems from start to end.
Subscribe if you like Software Development, Software Architecture and Systems Design!
Keep it up. Don't give up!
#golang #tutorial #databases
=== Our Vlog Channel
https://www.youtube.com/c/RubyCarrion/videos
=== Our affiliate links below
β My Amazon Storefront: https://www.amazon.com/shop/rubycarrion
β Shop my IG posts on my shopLTK page: https://www.shopltk.com/explore/RubyCarrion
β Vlog camera: Sony RX100 VII https://amzn.to/3qQfvMc
β Other vlog cameras and gear: https://rubycarrion.com/vlogcamerasandgear/
β Shop through my links to support the channel: https://rubycarrion.com/shop-my-links/
β Get a 30 day FREE Trial of Epidemic Sound: https://www.epidemicsound.com/referral/szx441/
β Join Rakuten for FREE and get $30 when you spend $30: https://www.rakuten.com/r/RUBYRA132?eeid=28187
DISCLAIMER: Some of the links shared in the description are affiliate links. As a member of these affiliate programs, I earn a small commission from your purchases at no additional cost to you. I appreciate your support! π
π Web & Search Guide Notes (DuckDuckGo, Yahoo & Bing):
Learn how to understand Learning Golang: Relational Databases - Introduction To Database/sql with this comprehensive video tutorial guide. In this video, you will gain step-by-step knowledge for Learning Golang: Relational Databases - Introduction To Database/sql.
Understanding Learning Golang: Relational Databases - Introduction To Database/sql requires clear step-by-step guidance and practical hands-on visual demonstrations. Follow along with top-rated video tutorials from industry experts today on TutorTube.
Watch Learning Golang: Relational Databases - Introduction To Database/sql full video tutorial and step-by-step course guide with high quality video and audio details on TutorTube.
Access this full course to enhance your skills efficiently on TutorTube.
π Lesson Overview & Learning Outcomes:
Welcome to the step-by-step video guide for Learning Golang: Relational Databases - Introduction to database/sql taught by Mario Carrion. This tutorial provides a comprehensive walkthrough designed to take you from foundational principles to practical implementation.
π‘ Key Topics Covered in This Course:
- Core Fundamentals & Setup: Understanding the workspace, essential tools, and initial setup for Learning Golang: Relational Databases - Introduction to database/sql.
- Step-by-Step Practical Demonstration: Hands-on implementation guided by Mario Carrion with real-world examples.
- Best Practices & Key Shortcuts: Time-saving workflows, keyboard shortcuts, and industry-standard recommendations.
- Troubleshooting & Common Pitfalls: How to avoid common beginner errors and optimize your workflow for peak efficiency.
π Recommended Prerequisites & Study Notes:
No prior advanced experience is required. Follow along with the video player above on any desktop computer, tablet, or mobile device. Pause and rewind at key steps to practice along with the instructor.
Explore more related video tutorials, course modules, and topic guides on TutorTube.