Skip to content

Commit 2dbf302

Browse files
committed
feat(mysql-driver): Provide a way to define pool options
1 parent c005f9f commit 2dbf302

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

packages/cubejs-mysql-driver/driver/MySqlDriver.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,14 @@ const GenericTypeToMySql = {
1111
class MySqlDriver extends BaseDriver {
1212
constructor(config) {
1313
super();
14+
const { pool, ...restConfig } = config || {};
1415
this.config = {
1516
host: process.env.CUBEJS_DB_HOST,
1617
database: process.env.CUBEJS_DB_NAME,
1718
port: process.env.CUBEJS_DB_PORT,
1819
user: process.env.CUBEJS_DB_USER,
1920
password: process.env.CUBEJS_DB_PASS,
20-
...config
21+
...restConfig
2122
};
2223
this.pool = genericPool.createPool({
2324
create: async () => {
@@ -50,7 +51,8 @@ class MySqlDriver extends BaseDriver {
5051
softIdleTimeoutMillis: 30000,
5152
idleTimeoutMillis: 30000,
5253
testOnBorrow: true,
53-
acquireTimeoutMillis: 20000
54+
acquireTimeoutMillis: 20000,
55+
...pool
5456
});
5557
}
5658

0 commit comments

Comments
 (0)