Give the Tasks API a real database, one query at a time.
The Tasks API you built in Building Web Services in Go keeps everything in a map, which forgets everything the moment it restarts. This book replaces that store with a real SQL database using nothing but the standard library's database/sql: opening a connection, reading and writing rows, handling NULL, versioned migrations, transactions, a SQL-backed implementation of the store interface, tests that run against an actual database, and generating type-safe queries with sqlc.
Start reading →The sql.DB Handle
Reading Rows
A SQL-Backed Store
Testing with a Database
Type-Safe Queries with sqlc