Skip to content
Effect 4.0 is here. One ecosystem. Zero dependencies.

MigratorFileSystem unstable

Loads SQL migrations by reading a directory.

1 exports Since v4.0.0 Source

Loaders

Since v4.0.0

Creates a migration loader that reads a directory with FileSystem, imports files named <id>_<name>.js, <id>_<name>.ts, <id>_<name>.mjs, or <id>_<name>.mts, and sorts migrations by id.

Details

Requires a Path service appropriate for the migration directory's path syntax. On Windows, prefer a platform-aware implementation such as NodePath.layer; the core Path.layer uses POSIX semantics and does not preserve Windows drive-letter paths.

Signature

declare const fromFileSystem: (directory: string) => Loader<FileSystem | Path>