Header menu logo Migrondi

From v1 and onwards Migrondi was built to be used as a library. This means that you can use Migrondi to run your own migrations from F# or C# code. and perhaps even extend Migrondi functionality. with your own.

Terminology

I try to be consistent with the terminology used in the library, in case you find something out of place please let me know.

URI Handling

Given that Migrondi.Core is designed to be used as a library, it's important to remark that internally all of the paths are expected to be URIs as that allows to work with both the local filesystem and URLs in case that's required by a remote file system of some kind implemented by you.

With that in mind I'd like yo remind you that

The first one is a file, the second one is a directory. and the same happens for relative URIs

This is important for the built-in file system service factory that requires both the projectRootUri and the migrationsRootUri to be directories.

Public API Guidelines

The public API is designed to be as simple as possible, and to be used as a library, so it's important to remark that the public API should not contain any Language Specific Type (e.g. in the case of F# it should not contain FSharpList<'T> or FSharpOption<'T>) in any of it's signatures. while this might make it clunky to work with in F# it makes it easier to use in C# and VB.

Usage

First, get it from NuGet

dotnet add package Migrondi.Core

After that most of the core is under it's own namespage e.g.

The ideal is to build up a MigrondiService instance which will work as the main interface for your code to handle the library.

The service is nothing too crazy it provides basic functionality to run migrations and related operations.

The same service provides also an async version of the same methods

While you could do this entirely on your own, there are some helper methods that you can use to get started, but for that you will need a couple of services as well.

That is a factory method that will create a new instance of the IMigrondi class.

Feel free to check the F# Scripts section to see a direct example of how to use the library in the most straight forward way.

The Migrondi.MigrondiFactory method returns a IMigrondi object provides the already orchestrated services that will work on a local file system although if you want to use migrondi for something custom (e.g. across network) you could implement your own services

For a more detailed information about the services check out

Type something to start searching.