Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RunSqliteMigrations ¶
RunSqliteMigrations applies all pending SQL schema migrations to the provided SQLite database.
This function uses the golang-migrate library and an embedded `io/fs` migration source. Migrations are expected to be located in the embedded filesystem path "migrations/sqlite". If no new migrations are found, it exits silently unless a non-ErrNoChange error occurs.
Parameters:
- db: a *sql.DB connection to the target SQLite database
Returns:
- An error if a migration setup or execution step fails, except when the database is already up to date.
Typical usage:
err := RunSqliteMigrations(db)
if err != nil {
log.Fatalf("migration failed: %v", err)
}
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.