database

package
v0.0.0-...-e8003ba Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 24, 2025 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RunSqliteMigrations

func RunSqliteMigrations(db *sql.DB) error

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL