-
-
Notifications
You must be signed in to change notification settings - Fork 628
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add enableKeepAlive property to ConnectionOptions interface #2286
Comments
Comparing the node-mysql2/typings/mysql/lib/Pool.d.ts Lines 41 to 49 in 8831e09
|
@wellwelwel I assumed they should be since they are defined in ConnectionConfig? node-mysql2/lib/connection_config.js Lines 120 to 121 in 8831e09
|
@luisasalas, yes, considering the typings consistency with the source code, the ideal would be to move them from Also: node-mysql2/lib/connection_config.js Line 29 in 8831e09
node-mysql2/lib/connection_config.js Line 35 in 8831e09
|
It should work as usual ✅ When using TypeScript, it will compile the code to JavaScript on build, then the Also, the declaration types from MySQL2 are separated from source code (neither depends on the other to work individually). Then these issues are really important to keep the typings consistent with the source code 🧑🏻🔧 |
Fixed in Now it will work for both import mysql, { PoolOptions, ConnectionOptions } from 'mysql2';
const poolOptions: PoolOptions = {
enableKeepAlive: true,
keepAliveInitialDelay: 0,
}
const connectionOptions: ConnectionOptions = {
enableKeepAlive: true,
keepAliveInitialDelay: 0,
}
mysql.createConnection(connectionOptions);
mysql.createPool(poolOptions);
mysql.createPoolCluster().add(poolOptions);
|
Noticed
enableKeepAlive
is missing onConnection.d.ts
The text was updated successfully, but these errors were encountered: