forked from mariadb-corporation/mariadb-connector-nodejs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcallback.js
24 lines (19 loc) · 856 Bytes
/
callback.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
"use strict";
const ConnectionCallback = require("./lib/connection-callback");
const PoolClusterCallback = require("./lib/pool-cluster-callback");
const PoolCallback = require("./lib/pool-callback");
const ConnOptions = require("./lib/config/connection-options");
const PoolOptions = require("./lib/config/pool-options");
const PoolClusterOptions = require("./lib/config/pool-cluster-options");
module.exports.createConnection = function createConnection(opts) {
return new ConnectionCallback(new ConnOptions(opts));
};
exports.createPool = function createPool(opts) {
const options = new PoolOptions(opts);
const pool = new PoolCallback(options);
pool.activatePool();
return pool;};
exports.createPoolCluster = function createPoolCluster(opts) {
const options = new PoolClusterOptions(opts);
return new PoolClusterCallback(options);
};