Skip to content

Open/Extend API to be less restrictive #25

Description

@Kafkalasch

The provided API / public methods are a bit cumbersome to use.

We want to use the library within our application AND use migration files. Unfortunately there does not seem to be an official way of how that is supported.

Ho we use it right now:

//go:linkname migrations github.com/deusdat/arangomigo.migrations
func migrations(migrationPath []string) ([]arangomigo.PairedMigrations, error)

//go:linkname perform github.com/deusdat/arangomigo.perform
func perform(ctx context.Context, c arangomigo.Config, pms []arangomigo.PairedMigrations) error

func DoMigration() error {
        config := arangomigo.Config{Db: dbName, Endpoints: []string{dbUrl}, MigrationsPath: []string{directory}}
	pms, _ := migrations(config.MigrationsPath)
	_ = perform(ctx, config, pms)
}

This allows the a simple usage of this library within our code base. The drawback is that this is only possible in this hacky way of using internal, non exported functions.

I would like to suggest to export those functions so they can be used that easily directly.

Metadata

Metadata

Assignees

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