Skip to content

Commit 67f793f

Browse files
gioboa아이작_조서환
andauthored
feat(mysql): add pool size options for each connection (#11810)
Co-authored-by: 아이작_조서환 <[email protected]>
1 parent 835647a commit 67f793f

2 files changed

Lines changed: 7 additions & 1 deletion

File tree

‎src/driver/mysql/MysqlConnectionCredentialsOptions.ts‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,4 +43,10 @@ export interface MysqlConnectionCredentialsOptions {
4343
* Database socket path
4444
*/
4545
readonly socketPath?: string
46+
47+
/**
48+
* Maximum number of clients the pool should contain.
49+
* for each connection
50+
*/
51+
readonly poolSize?: number
4652
}

‎src/driver/mysql/MysqlDriver.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1287,7 +1287,7 @@ export class MysqlDriver implements Driver {
12871287
port: credentials.port,
12881288
ssl: options.ssl,
12891289
socketPath: credentials.socketPath,
1290-
connectionLimit: options.poolSize,
1290+
connectionLimit: credentials.poolSize ?? options.poolSize,
12911291
},
12921292
options.acquireTimeout === undefined
12931293
? {}

0 commit comments

Comments
 (0)