Building Database Applications with Database/SQL
summary
Demonstrates using Go's database/sql with MySQL and gives concrete rules: open creates a long‑lived DB object, use exec for non‑row commands and close rows promptly to avoid leaking connections, bind a connection with a transaction (TX) when you need session state, watch for a surprising ten‑retry loop on bad connections, hit a 16k prepared‑statement limit under high concurrency, and notes driver quirks like unsigned uint64 handling and a DBControl cap tool the team built and uses.
AI-written summary · about
chapters (16)
- 0:00Introduction
- 1:15Go database/sql resources
- 2:17Skepticism and rediscovery
- 5:27Hello world setup
- 8:35Querying single rows
- 10:41Parameterized queries
- 12:28Handling result sets
- 15:59Explicit statement preparing
- 18:30Non-query operations with exec
- 19:54Connection pool management
- 23:44Resource leaks and cleanup
- 24:50Transactions and connection state
- 27:18Retry behavior in database/sql
- 29:05NULL values and custom types
- 30:53Additional resources
- 31:15Q&A
related talks
45mdatabase/sql: the bad, the good and the ugly — developing a driver for YDB
39m10 Things Developers should know about Databases
39mBuilding Production Applications Using Go
02h 42mSQL (The Return): Demystifying Preconceptions and Using the DB Effectively
39mHow to test Go code with a database?
37mArchitecture Guidance
35m10 things a developer should know about databases
01h 29mWorking with Databases and Groovy
