Thanks to visit codestin.com
Credit goes to effect-ts.github.io

Skip to main content Codestin Search App Codestin Search App Codestin Search App Codestin Search App Codestin Search App Codestin Search App

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

fromRecord

Signature

declare const fromRecord: (migrations: Record<string, Effect.Effect<void, unknown, Client.SqlClient>>) => Loader

Source

Since v1.0.0

model

Loader (type alias)

Signature

type Loader<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, any, Client.SqlClient>]

Source

Since v1.0.0