Missing type
PoolConfig does not include the verify option, which is a documented feature of the underlying pg-pool package.
pg-pool source (pg-pool/index.js, lines 347–361):
if (isNew && this.options.verify) {
this.options.verify(client, (err) => { ... })
}
// ...
if (isNew && this.options.verify) {
this.options.verify(client, client.release)
}
Current PoolConfig (@types/pg 8.20.0, the latest):
export interface PoolConfig extends ClientConfig {
// properties from module 'pg-pool'
max?: number | undefined;
min?: number | undefined;
idleTimeoutMillis?: number | undefined | null;
log?: ((...messages: any[]) => void) | undefined;
Promise?: PromiseConstructorLike | undefined;
allowExitOnIdle?: boolean | undefined;
maxUses?: number | undefined;
maxLifetimeSeconds?: number | undefined;
Client?: (new() => ClientBase) | undefined;
onConnect?: ((client: ClientBase) => void) | undefined;
// verify is missing
}
Suggested fix
export interface PoolConfig extends ClientConfig {
// ... existing properties ...
verify?: ((client: PoolClient, done: (err?: Error) => void) => void) | undefined;
}
Impact
Without this type, any code using the verify hook must cast the entire Pool config object to any to avoid a TypeScript error, losing type-checking for all other pool options.
Missing type
PoolConfigdoes not include theverifyoption, which is a documented feature of the underlyingpg-poolpackage.pg-pool source (
pg-pool/index.js, lines 347–361):Current
PoolConfig(@types/pg8.20.0, the latest):Suggested fix
Impact
Without this type, any code using the
verifyhook must cast the entirePoolconfig object toanyto avoid a TypeScript error, losing type-checking for all other pool options.