Database/SQL talk for Denver Gophers. Drivers and code examples are on the package page.
Import syntax, the empty _
import
Building the connection string
Knowing the parameterization scheme
Exec
versus Query
Scanning into pointers
Closing rows
The scanner interface
Cross-platform issues
Talk struct
with the database!
Default INSERT
values and dealing with NULL
values with pointers or Null types.
The case of the disappearing table.
Strings are scanned as []byte
, resulting in unexpected json
output.
Build one to test instances requiring a connection
A list of popular projects
- sqlx - provides a super-set of the
database/sql
library - Goose - database migrations
- Go Relational Persistence - talk
struct
with the database - GORM - talk
struct
with the database
And my own: Aspect - cross-dialect query construction, schema declarations, and talking a variety of types with the database (including structs and slices)