forked from sidorares/node-mysql2
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
33 lines (26 loc) · 1.05 KB
/
index.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
25
26
27
28
29
30
31
32
33
var Connection = require('./lib/connection.js');
var ConnectionConfig = require('./lib/connection_config.js');
var SqlString = require('./lib/sql_string.js');
module.exports.createConnection = function(opts) {
return new Connection({config: new ConnectionConfig(opts)});
};
module.exports.connect = module.exports.createConnection;
module.exports.Connection = Connection;
module.exports.Types = require('./lib/constants/types.js');
module.exports.createPool = function(config) {
var PoolConfig = require('./lib/pool_config.js');
var Pool = require('./lib/pool.js');
return new Pool({config: new PoolConfig(config)});
};
exports.createPoolCluster = function(config) {
var PoolConfig = require('./lib/pool_config.js');
var PoolCluster = require('./lib/pool_cluster.js');
return new PoolCluster(config);
};
module.exports.createServer = function() {
var Server = require('./lib/server.js');
return new Server();
};
exports.escape = SqlString.escape;
exports.escapeId = SqlString.escapeId;
exports.format = SqlString.format;