mysql2 3.11.4 → 3.11.5-canary.cdc9415c
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.js +16 -22
- package/lib/base/connection.js +945 -0
- package/lib/base/pool.js +233 -0
- package/lib/base/pool_connection.js +63 -0
- package/lib/connection.js +3 -939
- package/lib/create_connection.js +10 -0
- package/lib/create_pool.js +10 -0
- package/lib/create_pool_cluster.js +9 -0
- package/lib/packets/packet.js +7 -5
- package/lib/parsers/binary_parser.js +2 -2
- package/lib/pool.js +3 -229
- package/lib/pool_connection.js +3 -60
- package/lib/promise/connection.js +222 -0
- package/lib/promise/inherit_events.js +27 -0
- package/lib/promise/make_done_cb.js +19 -0
- package/lib/promise/pool.js +112 -0
- package/lib/promise/pool_connection.js +19 -0
- package/lib/promise/prepared_statement_info.js +32 -0
- package/package.json +5 -4
- package/promise.js +56 -439
package/index.js
CHANGED
|
@@ -2,30 +2,24 @@
|
|
|
2
2
|
|
|
3
3
|
const SqlString = require('sqlstring');
|
|
4
4
|
|
|
5
|
-
const Connection = require('./lib/connection.js');
|
|
6
5
|
const ConnectionConfig = require('./lib/connection_config.js');
|
|
7
|
-
const parserCache = require('./lib/parsers/parser_cache');
|
|
6
|
+
const parserCache = require('./lib/parsers/parser_cache.js');
|
|
8
7
|
|
|
9
|
-
|
|
10
|
-
return new Connection({ config: new ConnectionConfig(opts) });
|
|
11
|
-
};
|
|
8
|
+
const Connection = require('./lib/connection.js');
|
|
12
9
|
|
|
10
|
+
exports.createConnection = require('./lib/create_connection.js');
|
|
13
11
|
exports.connect = exports.createConnection;
|
|
14
12
|
exports.Connection = Connection;
|
|
15
13
|
exports.ConnectionConfig = ConnectionConfig;
|
|
16
14
|
|
|
17
15
|
const Pool = require('./lib/pool.js');
|
|
18
16
|
const PoolCluster = require('./lib/pool_cluster.js');
|
|
17
|
+
const createPool = require('./lib/create_pool.js');
|
|
18
|
+
const createPoolCluster = require('./lib/create_pool_cluster.js');
|
|
19
19
|
|
|
20
|
-
exports.createPool =
|
|
21
|
-
const PoolConfig = require('./lib/pool_config.js');
|
|
22
|
-
return new Pool({ config: new PoolConfig(config) });
|
|
23
|
-
};
|
|
20
|
+
exports.createPool = createPool;
|
|
24
21
|
|
|
25
|
-
exports.createPoolCluster =
|
|
26
|
-
const PoolCluster = require('./lib/pool_cluster.js');
|
|
27
|
-
return new PoolCluster(config);
|
|
28
|
-
};
|
|
22
|
+
exports.createPoolCluster = createPoolCluster;
|
|
29
23
|
|
|
30
24
|
exports.createQuery = Connection.createQuery;
|
|
31
25
|
|
|
@@ -33,7 +27,7 @@ exports.Pool = Pool;
|
|
|
33
27
|
|
|
34
28
|
exports.PoolCluster = PoolCluster;
|
|
35
29
|
|
|
36
|
-
exports.createServer = function(handler) {
|
|
30
|
+
exports.createServer = function (handler) {
|
|
37
31
|
const Server = require('./lib/server.js');
|
|
38
32
|
const s = new Server();
|
|
39
33
|
if (handler) {
|
|
@@ -42,7 +36,7 @@ exports.createServer = function(handler) {
|
|
|
42
36
|
return s;
|
|
43
37
|
};
|
|
44
38
|
|
|
45
|
-
exports.PoolConnection = require('./lib/pool_connection');
|
|
39
|
+
exports.PoolConnection = require('./lib/pool_connection.js');
|
|
46
40
|
exports.authPlugins = require('./lib/auth_plugins');
|
|
47
41
|
exports.escape = SqlString.escape;
|
|
48
42
|
exports.escapeId = SqlString.escapeId;
|
|
@@ -51,33 +45,33 @@ exports.raw = SqlString.raw;
|
|
|
51
45
|
|
|
52
46
|
exports.__defineGetter__(
|
|
53
47
|
'createConnectionPromise',
|
|
54
|
-
() => require('./promise.js').createConnection
|
|
48
|
+
() => require('./promise.js').createConnection,
|
|
55
49
|
);
|
|
56
50
|
|
|
57
51
|
exports.__defineGetter__(
|
|
58
52
|
'createPoolPromise',
|
|
59
|
-
() => require('./promise.js').createPool
|
|
53
|
+
() => require('./promise.js').createPool,
|
|
60
54
|
);
|
|
61
55
|
|
|
62
56
|
exports.__defineGetter__(
|
|
63
57
|
'createPoolClusterPromise',
|
|
64
|
-
() => require('./promise.js').createPoolCluster
|
|
58
|
+
() => require('./promise.js').createPoolCluster,
|
|
65
59
|
);
|
|
66
60
|
|
|
67
61
|
exports.__defineGetter__('Types', () => require('./lib/constants/types.js'));
|
|
68
62
|
|
|
69
63
|
exports.__defineGetter__('Charsets', () =>
|
|
70
|
-
require('./lib/constants/charsets.js')
|
|
64
|
+
require('./lib/constants/charsets.js'),
|
|
71
65
|
);
|
|
72
66
|
|
|
73
67
|
exports.__defineGetter__('CharsetToEncoding', () =>
|
|
74
|
-
require('./lib/constants/charset_encodings.js')
|
|
68
|
+
require('./lib/constants/charset_encodings.js'),
|
|
75
69
|
);
|
|
76
70
|
|
|
77
|
-
exports.setMaxParserCache = function(max) {
|
|
71
|
+
exports.setMaxParserCache = function (max) {
|
|
78
72
|
parserCache.setMaxCache(max);
|
|
79
73
|
};
|
|
80
74
|
|
|
81
|
-
exports.clearParserCache = function() {
|
|
75
|
+
exports.clearParserCache = function () {
|
|
82
76
|
parserCache.clearCache();
|
|
83
77
|
};
|