Skip to content

Commit 16a155b

Browse files
committed
fix: use Promise<Client> type for connectPromise instead of .then(() => {})
Updated the type annotation to match @types/pg@8.18.0 where Client.connect() now correctly returns Promise<Client> (was incorrectly typed as Promise<void> in @types/pg@8.16.0). No behavioral change — the runtime always returned Promise<Client>.
1 parent aa09f9e commit 16a155b

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

postgres/pgsql-client/src/client.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ export class PgClient {
1616
protected ctxStmts: string = '';
1717
protected contextSettings: PgTestClientContext = {};
1818
protected _ended: boolean = false;
19-
protected connectPromise: Promise<void> | null = null;
19+
protected connectPromise: Promise<Client> | null = null;
2020

2121
constructor(config: PgConfig, opts: PgClientOpts = {}) {
2222
this.opts = opts;
@@ -29,7 +29,7 @@ export class PgClient {
2929
password: this.config.password
3030
});
3131
if (!opts.deferConnect) {
32-
this.connectPromise = this.client.connect().then(() => {});
32+
this.connectPromise = this.client.connect();
3333
if (opts.trackConnect) opts.trackConnect(this.connectPromise);
3434
}
3535
}

0 commit comments

Comments
 (0)