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

21 lines
391 B
Markdown

# 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
//go:embed migrations
var migrations embed.FS
func init() {
Migrate(db, migrations) // Check the error, of course.
}
```