From 5fb7395a40f3db1d45457198e71895a5b25ebfee Mon Sep 17 00:00:00 2001 From: Stefan Andres Charsley Date: Thu, 25 Jan 2018 23:33:55 +1300 Subject: [PATCH] - Updated type definitions to accept db client config --- index.d.ts | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/index.d.ts b/index.d.ts index 10b985e1..c125350f 100644 --- a/index.d.ts +++ b/index.d.ts @@ -374,8 +374,23 @@ export class PgLiteral { toString(): string } +export interface ConnectionConfig { + user?: string; + database?: string; + password?: string; + port?: number; + host?: string; + connectionString?: string; +} + +import { TlsOptions } from "tls"; + +export interface ClientConfig extends ConnectionConfig { + ssl?: boolean | TlsOptions; +} + export interface RunnerOption { - database_url: string + database_url: string | ClientConfig migrations_table: string migrations_schema?: string schema?: string @@ -390,3 +405,12 @@ export interface RunnerOption { } export default function (options: RunnerOption): Promise + +export interface UnlockRunnerOption { + database_url: string | ClientConfig + migrations_table: string + migrations_schema?: string + schema?: string +} + +export function unlockRunner(options: RunnerOption): Promise