Skip to content

Commit 6de4adb

Browse files
committed
refactor(pgsql-test): replace 'opts: any' with proper PgTestClientOpts typing
- Export PgTestClientOpts type from test-client.ts - Import and use PgTestClientOpts in manager.ts getClient() signature - Change opts parameter from 'any' to 'Partial<PgTestClientOpts>' - Improves type safety and removes 'any' type usage Co-Authored-By: Dan Lynch <pyramation@gmail.com>
1 parent 7be06a1 commit 6de4adb

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

packages/pgsql-test/src/manager.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { Pool } from 'pg';
33
import { getPgEnvOptions, PgConfig } from 'pg-env';
44

55
import { DbAdmin } from './admin';
6-
import { PgTestClient } from './test-client';
6+
import { PgTestClient, PgTestClientOpts } from './test-client';
77

88
const log = new Logger('test-connector');
99

@@ -84,7 +84,7 @@ export class PgTestConnector {
8484
return this.pgPools.get(key)!;
8585
}
8686

87-
getClient(config: PgConfig, opts: any = {}): PgTestClient {
87+
getClient(config: PgConfig, opts: Partial<PgTestClientOpts> = {}): PgTestClient {
8888
if (this.shuttingDown) {
8989
throw new Error('PgTestConnector is shutting down; no new clients allowed');
9090
}

packages/pgsql-test/src/test-client.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { PgConfig } from 'pg-env';
33
import { AuthOptions, PgTestConnectionOptions } from '@launchql/types';
44
import { getRoleName } from './roles';
55

6-
type PgTestClientOpts = {
6+
export type PgTestClientOpts = {
77
deferConnect?: boolean;
88
trackConnect?: (p: Promise<any>) => void;
99
} & Partial<PgTestConnectionOptions>;

0 commit comments

Comments
 (0)