Skip to content

Commit

Permalink
fix: added typings for acquireTimeout option
Browse files Browse the repository at this point in the history
  • Loading branch information
fenying committed Apr 10, 2024
1 parent 1e3cf9b commit ec0fde9
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
4 changes: 4 additions & 0 deletions test/tsc-build/mysql/createPool/callbacks/createPool.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,8 @@ import { uriAccess, access } from '../../baseConnection.test.js';

uriPool = mysql.createPool(uriAccess);
pool = mysql.createPool(access);
pool = mysql.createPool({
...access,
acquireTimeout: 1000,
});
})();
7 changes: 7 additions & 0 deletions typings/mysql/lib/Pool.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,13 @@ export interface PoolOptions extends ConnectionOptions {
*/
connectionLimit?: number;

/**
* The maximum time (in milliseconds) to wait for getting a connection from the pool. (Default: 10 seconds)
*
* @default 10000
*/
acquireTimeout?: number;

/**
* The maximum number of idle connections. (Default: same as `connectionLimit`)
*/
Expand Down

0 comments on commit ec0fde9

Please sign in to comment.