391 B
391 B
sqliteutil
Transactions
Simplify transactions using WithTx
.
Migrations
Put your migrations into a directory, for example migrations
, ordered by name
(YYYY-MM-DD prefix, for example). Embed the directory and pass it to the
Migrate
function:
//go:embed migrations
var migrations embed.FS
func init() {
Migrate(db, migrations) // Check the error, of course.
}