Skip to content

Using Go 1.16 io/fs as a source for DB migrations #514

@fasmat

Description

@fasmat

With golang 1.16 the io/fs package was introduced that among other things allows the use of embedded files in go programs.

Is it already possible to embed migrations into a binary and execute them with golang-migrate?

I'm not yet using golang-migrate but I'm looking for a library that can potentially do this. I've seen that golang-migrate has this interface https://pkg.go.dev/github.com/golang-migrate/migrate/v4/source#Driver. I assume one would need to write a driver implementing the interface and mapping onto https://golang.org/pkg/io/fs/#FS to use golang 1.16 embedded files?

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