UNPKG

pg-flyway

Version:

Migration tool for PostgreSQL database, NodeJS version of Java migration tool - flyway (not wrapper for https://flywaydb.org/documentation/commandline)

44 lines (43 loc) 1.71 kB
import { Logger } from 'log4js'; import { MgrationFileMetadata, Migration } from '../types/migration'; import { PoolClient } from '../types/pool-client'; import { HistoryTableService } from './history-table.service'; export declare class MigrateService { private readonly options; protected logger: Logger; protected Pool: any; protected client: any; protected historyTableService: HistoryTableService; constructor(options: { dryRun?: boolean; historyTable?: string; historySchema?: string; databaseUrl: string; locations: string[]; sqlMigrationSuffixes: string[]; sqlMigrationSeparator: string; sqlMigrationStatementSeparator: string; }); getHistoryTableService(): HistoryTableService; destroy(): void; getClient(): Promise<any>; migrate(): Promise<void>; private getMigrations; private loopForRepeatableMigrations; private loopForVersionedMigrations; loadMigrationFile(filepath: string): Promise<string>; execSql({ client, query, placeholders, }: { client?: PoolClient; query: string; migration?: Migration; placeholders: Record<string, string>; }): Promise<any>; execSqlForStatements<T = any>({ migration, beforeEachStatement, afterEachStatement, errorEachStatement, placeholders, }: { migration: Migration; beforeEachStatement?: (client: PoolClient) => Promise<void>; afterEachStatement?: (client: PoolClient) => Promise<void>; errorEachStatement?: (client: PoolClient) => Promise<void>; placeholders: Record<string, any>; }): Promise<T[]>; getFiles(): Promise<MgrationFileMetadata[]>; }