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
>
Since v1.0.0
errors
MigrationError (class)
Signature
declare class MigrationError
Since v1.0.0
loaders
fromBabelGlob
Signature
declare const fromBabelGlob: (migrations: Record<string, any>) => Loader
Since v1.0.0
fromGlob
Signature
declare const fromGlob: (migrations: Record<string, () => Promise<any>>) => Loader
Since v1.0.0
model
Loader (type alias)
Signature
type Effect.Effect<ReadonlyArray<ResolvedMigration>, MigrationError, R> = Effect.Effect<
ReadonlyArray<ResolvedMigration>,
MigrationError,
R
>
Since v1.0.0
Migration (interface)
Signature
export interface Migration {
readonly id: number
readonly name: string
readonly createdAt: Date
}
Since v1.0.0
MigratorOptions (interface)
Signature
export interface MigratorOptions<R = never> {
readonly loader: Loader<R>
readonly schemaDirectory?: string
readonly table?: string
}
Since v1.0.0
ResolvedMigration (type alias)
Signature
type ResolvedMigration = readonly [id: number, name: string, load: Effect.Effect<any>]
Since v1.0.0