go/sqliteutil/README.md
2024-11-12 20:57:56 +01:00

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.
}