Skip to main content Link Search Menu Expand Document (external link)

Migrator.ts overview

Since v1.0.0


Exports Grouped by Category


constructor

make

Signature

declare const make: <RD = never>({
  dumpSchema
}: {
  dumpSchema?: (path: string, migrationsTable: string) => Effect.Effect<void, MigrationError, RD>
}) => <R2 = never>({
  loader,
  schemaDirectory,
  table
}: MigratorOptions<R2>) => Effect.Effect<
  ReadonlyArray<readonly [id: number, name: string]>,
  MigrationError | SqlError,
  Client.SqlClient | RD | R2
>

Source

Since v1.0.0

errors

MigrationError (class)

Signature

declare class MigrationError

Source

Since v1.0.0

loaders

fromBabelGlob

Signature

declare const fromBabelGlob: (migrations: Record<string, any>) => Loader

Source

Since v1.0.0

fromGlob

Signature

declare const fromGlob: (migrations: Record<string, () => Promise<any>>) => Loader

Source

Since v1.0.0

model

Loader (type alias)

Signature

type Effect.Effect<ReadonlyArray<ResolvedMigration>, MigrationError, R> = Effect.Effect<
  ReadonlyArray<ResolvedMigration>,
  MigrationError,
  R
>

Source

Since v1.0.0

Migration (interface)

Signature

export interface Migration {
  readonly id: number
  readonly name: string
  readonly createdAt: Date
}

Source

Since v1.0.0

MigratorOptions (interface)

Signature

export interface MigratorOptions<R = never> {
  readonly loader: Loader<R>
  readonly schemaDirectory?: string
  readonly table?: string
}

Source

Since v1.0.0

ResolvedMigration (type alias)

Signature

type ResolvedMigration = readonly [id: number, name: string, load: Effect.Effect<any>]

Source

Since v1.0.0