Closed Arnoldnuo closed 3 years ago
I have no immediate plan to add it myself. Maybe eventually if I get time. If you want to look at implementing it, see how lib/pool.js
and lib/connection.js
work and feel free to submit a pull request.
I'm working on this, but I need to be able to create a promise-mysql Pool from an existing underlying mysql Pool. Something like
class pool {
- constructor(config = {}) {
+ constructor(config = {}, _pool) {
+ if (_pool) {
+ this.pool = _pool;
+ return this;
+ }
}
How do you feel about that, @CodeFoodPixels ?
The alternative is to have PoolCluster.of() return an underlying (non-promisified) pool.
Completely happy with that, it's similar to what happens in the connection
I've made the changes in the cluster branch.
I'm not familiar with tap and sinon though. I'm having trouble with one test. poolCluster.on can be called with one or two parameters and I can't seem to get the test with one parameter working.
Can you take a look?
This has been added in #146 and published to NPM in version 5.0.0, thanks @move-zig!
I love async/await, but this lib don`t support createPoolCluser, how can i change createPoolCluser to promise?