Войти
  • 58018Просмотров
  • 2 года назадОпубликованоBugBytes

Go - SQL Databases in Golang with the database/sql package

Playlist ▶️: In this video, we'll look at the database/sql package in Go, and how to use this package to work with SQL relational databases. We will look at how to connect to a PostgreSQL database running in a Docker container, and how to create tables, insert data and query data using the Go database package. We'll look at the difference between three database functions: - () - () - () And will outline when to use each. Playlist: ☕️ 𝗕𝘂𝘆 𝗺𝗲 𝗮 𝗰𝗼𝗳𝗳𝗲𝗲: To support the channel and encourage new videos, please consider buying me a coffee here: 📌 𝗖𝗵𝗮𝗽𝘁𝗲𝗿𝘀: 00:00 Intro 00:49 Setting up PostgreSQL Docker container 04:20 Connecting to Postgres from Go app with 09:36 Creating table in database with CREATE TABLE SQL 14:28 Inserting data into table with Go 22:02 Querying single row with () 26:21 Querying for multiple rows with () 𝗦𝗼𝗰𝗶𝗮𝗹 𝗠𝗲𝗱𝗶𝗮: 📖 Blog: 👾 Github: 📚 𝗙𝘂𝗿𝘁𝗵𝗲𝗿 𝗿𝗲𝗮𝗱𝗶𝗻𝗴 𝗮𝗻𝗱 𝗶𝗻𝗳𝗼𝗿𝗺𝗮𝘁𝗶𝗼𝗻: Go database/sql package: Go Postgres driver pq: #golang #webdevelopment #database #sql