Skip to content
Effect Days 2026 Early bird tickets

LibsqlMigrator

libSQL migration support for Effect SQL applications.

This module adapts the shared SQL migrator to libSQL. It re-exports the common migration loaders and errors, then provides run and layer helpers that apply pending migrations with the current libSQL-backed SqlClient. run returns the applied migration IDs and names, while layer runs migrations during layer construction and provides no services.

2 exports Added in v4.0.0 Source

Layers

layer

Added in v4.0.0 Source

Creates a layer that runs the configured SQL migrations during layer construction.

Signature

declare function layer<R>(options: MigratorOptions<R>): Layer<never, any, any>

Running

run

Added in v4.0.0 Source

Runs SQL migrations using the configured SqlClient, returning the migrations that were applied.

Signature

declare const run: <R2 = never>(options: Migrator.MigratorOptions<R2>) => Effect.Effect<ReadonlyArray<readonly [id: number, name: string]>, Migrator.MigrationError | SqlError, Client.SqlClient | R2>