go/sqliteutil
2024-11-18 17:01:17 +01:00
..
test-migrations wip 2024-11-11 06:36:55 +01:00
errors.go wip 2024-11-18 17:01:17 +01:00
migrate_test.go wip 2024-11-11 06:36:55 +01:00
migrate.go wip 2024-11-11 06:36:55 +01:00
README.md wip 2024-11-12 20:57:56 +01:00
tx.go wip 2024-11-11 06:36:55 +01:00

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