Skip to content

Fix `AttachOptions` to work when a separate store is provided via `WithStore`

With addition of provider to the library (see https://pressly.github.io/goose/blog/2023/goose-provider/) , the original way of providing store options via goose.AttachOptions doesn't work when a store is provided via WithStore.

store, _ := database.NewStore(...)

goose.AttachOptions(...)

goose.NewProvider(...
..
goose.WithStore(store) // <--- this store will not have options set and default will be used.
..
)

We should fix this.