We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
file:///
sqlite3:///
Describe the Bug SQLite3 accepts file URL with prefix file:///, but golang-migrate requires prefix sqlite3:///.
Steps to Reproduce Steps to reproduce the behavior:
file:///path/to/sqlite3.db
sqlite3:///path/to/sqlite3.db
Expected Behavior I should be able to call this code in following way, with no error, and with positive functionality:
File migrations/embed.go:
migrations/embed.go
package migrations //go:embed *.sql var FS embed.FS
File db.go:
db.go
... iofsDriver, iofsErr := iofs.New(migrations.FS, ".") if iofsErr != nil { return fmt.Errorf("cannot open database migration embedded directory: %w", iofsErr) } m, mErr := migrate.NewWithSourceInstance("iofs", iofsDriver, `sqlite3:///path/to/sqlite3.db`) if mErr != nil { return fmt.Errorf("cannot open database migration helper: %w", mErr) } if migrateErr := m.Up(); migrateErr != nil { if !errors.Is(migrateErr, migrate.ErrNoChange) { return fmt.Errorf("cannot perform database migration: %w", migrateErr) } } ...
Migrate Version From go.mod: github.com/golang-migrate/migrate/v4 v4.17.0 I don't have CLI installed. Calling it from Go code.
go.mod
Loaded Source Drivers Already described above.
Loaded Database Drivers Already described above.
Go Version go version go1.22.1 darwin/arm64
Stacktrace None.
Additional context Running this in fyne on a mobile app. Incidentally, if i run the following similar code, there is no error:
... config := &sqlite3.Config{} driver, driverErr := sqlite3.WithInstance(db.dbx.DB, config) if driverErr != nil { return fmt.Errorf("cannot open database migration driver: %w", driverErr) } m, mErr := migrate.NewWithInstance("iofs", iofsDriver, "", driver) if mErr != nil { return fmt.Errorf("cannot open database migration helper: %w", mErr) } if migrateErr := m.Up(); migrateErr != nil { if !errors.Is(migrateErr, migrate.ErrNoChange) { return fmt.Errorf("cannot perform database migration: %w", migrateErr) } } ...
The text was updated successfully, but these errors were encountered:
Should accept file URI, and possible DB type string.
Sorry, something went wrong.
No branches or pull requests
Describe the Bug
SQLite3 accepts file URL with prefix
file:///
, but golang-migrate requires prefixsqlite3:///
.Steps to Reproduce
Steps to reproduce the behavior:
file:///path/to/sqlite3.db
.file:///path/to/sqlite3.db
.sqlite3:///path/to/sqlite3.db
.Expected Behavior
I should be able to call this code in following way, with no error, and with positive functionality:
File
migrations/embed.go
:File
db.go
:Migrate Version
From
go.mod
: github.com/golang-migrate/migrate/v4 v4.17.0I don't have CLI installed. Calling it from Go code.
Loaded Source Drivers
Already described above.
Loaded Database Drivers
Already described above.
Go Version
go version go1.22.1 darwin/arm64
Stacktrace
None.
Additional context
Running this in fyne on a mobile app.
Incidentally, if i run the following similar code, there is no error:
The text was updated successfully, but these errors were encountered: