Skip to content

Commit

Permalink
ci(types): enableKeepAlive and keepAliveInitialDelay
Browse files Browse the repository at this point in the history
  • Loading branch information
wellwelwel committed Nov 21, 2023
1 parent 6b761be commit fbcff3c
Showing 1 changed file with 35 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
import { mysql, mysqlp } from '../index.js';

// Callback
(() => {
const poolOptions: mysql.PoolOptions = {
enableKeepAlive: true,
keepAliveInitialDelay: 0,
}

const connectionOptions: mysql.ConnectionOptions = {
enableKeepAlive: true,
keepAliveInitialDelay: 0,
}

mysql.createConnection(connectionOptions);
mysql.createPool(poolOptions);
mysql.createPoolCluster().add(poolOptions);
})();

// Promise
(() => {
const poolOptions: mysqlp.PoolOptions = {
enableKeepAlive: true,
keepAliveInitialDelay: 0,
}

const connectionOptions: mysqlp.ConnectionOptions = {
enableKeepAlive: true,
keepAliveInitialDelay: 0,
}

mysqlp.createConnection(connectionOptions);
mysqlp.createPool(poolOptions);
mysqlp.createPoolCluster().add(poolOptions);
})();

0 comments on commit fbcff3c

Please sign in to comment.