Skip to content

Issue with Turso + Goose provider #960

@pedelman

Description

@pedelman

Hello, I recently ran into an issue with Goose + Turso when trying to leverage the Provider to migrate multiple Turso DBs.

provider, err := goose.NewProvider(
	database.DialectTurso,
	db.DB,
	os.DirFS(migrationsDir),
)
if err != nil {
	logger.Error(err.Error())
	continue
}

_, err = provider.Up(ctx)
if err != nil {
	logger.Error(err.Error())
	continue
}
{"time":"2025-06-21T18:28:32.642253-05:00","level":"ERROR","msg":"failed to list migrations: failed to execute SQL:\nstream is closed: driver: bad connection; sql: connection is already closed"}

When I run the migrations via Goose command directly, they work just fine.

GOOSE_DRIVER=turso GOOSE_DBSTRING="libsql://REDACTED" goose up -dir migrations/client-db
2025/06/21 18:29:30 goose: no migrations to run. current version: 20250204025224

Dependencies and Go version:

go 1.23.0

require (
	github.com/jmoiron/sqlx v1.4.0
	github.com/joho/godotenv v1.5.1
	github.com/pressly/goose/v3 v3.24.3
)

require (
	github.com/antlr4-go/antlr/v4 v4.13.1 // indirect
	github.com/coder/websocket v1.8.13 // indirect
	github.com/mfridman/interpolate v0.0.2 // indirect
	github.com/sethvargo/go-retry v0.3.0 // indirect
	github.com/tursodatabase/libsql-client-go v0.0.0-20240902231107-85af5b9d094d // indirect
	go.uber.org/multierr v1.11.0 // indirect
	golang.org/x/exp v0.0.0-20250506013437-ce4c2cf36ca6 // indirect
	golang.org/x/sync v0.15.0 // indirect
)

Thanks in advance and please let me know if I can provide any other helpful information for my setup. Whats a bit puzzling is that this worked before.

Previously this was working on github.com/pressly/goose/v3 v3.24.0.

I updated to confirm its still not working on latest.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions