Skip to content

Data

  • The data layer: How the db package finds its connection, turns method calls into SQL, and why it works the way it does.
  • Migrations: Migrations are Go values compiled into your binary. The runner applies them in ID order, records each one in the migrations table with the batch it ran in, and wraps each in a transaction where the database allows it. A database lock keeps two instances from migrating at once.