2024-11-11 05:36:55 +00:00
|
|
|
# sqliteutil
|
|
|
|
|
|
|
|
## Transactions
|
|
|
|
|
2024-11-12 19:57:56 +00:00
|
|
|
Simplify transactions using `WithTx`.
|
2024-11-11 05:36:55 +00:00
|
|
|
|
|
|
|
## 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.
|
|
|
|
}
|
|
|
|
```
|