@depup/mysql2 3.22.0-depup.0 → 3.23.2-depup.0
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/README.md +9 -3
- package/changes.json +8 -3
- package/lib/base/connection.js +4 -2
- package/lib/base/pool.js +4 -0
- package/lib/commands/client_handshake.js +26 -2
- package/lib/commands/execute.js +17 -4
- package/lib/commands/ping.js +1 -1
- package/lib/commands/prepare.js +10 -2
- package/lib/commands/query.js +2 -1
- package/lib/compressed_protocol.js +1 -1
- package/lib/connection_config.js +1 -0
- package/lib/constants/charset_encodings.js +25 -1
- package/lib/constants/mariadb_client.js +19 -0
- package/lib/packets/binary_row.js +2 -2
- package/lib/packets/binlog_query_statusvars.js +1 -1
- package/lib/packets/change_user.js +1 -1
- package/lib/packets/column_definition.js +35 -1
- package/lib/packets/encode_parameter.js +12 -2
- package/lib/packets/execute.js +8 -2
- package/lib/packets/handshake.js +13 -1
- package/lib/packets/handshake_response.js +5 -1
- package/lib/packets/packet.js +51 -3
- package/lib/packets/resultset_header.js +1 -1
- package/lib/packets/ssl_request.js +6 -1
- package/lib/packets/text_row.js +1 -1
- package/lib/parsers/binary_parser.js +45 -6
- package/lib/parsers/parser_cache.js +3 -0
- package/lib/parsers/static_binary_parser.js +37 -2
- package/lib/parsers/static_text_parser.js +21 -2
- package/lib/parsers/text_parser.js +15 -9
- package/lib/promise/capture_local_err.js +25 -0
- package/lib/promise/connection.js +35 -40
- package/lib/promise/make_done_cb.js +5 -9
- package/lib/promise/pool.js +11 -9
- package/lib/promise/pool_cluster.js +9 -2
- package/lib/promise/prepared_statement_info.js +5 -1
- package/package.json +13 -8
- package/promise.js +16 -15
- package/typings/mysql/lib/Connection.d.ts +7 -1
- package/typings/mysql/lib/parsers/typeCast.d.ts +11 -0
- package/typings/mysql/lib/protocol/packets/FieldPacket.d.ts +11 -0
- package/typings/mysql/lib/protocol/sequences/Query.d.ts +7 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@depup/mysql2",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.23.2-depup.0",
|
|
4
4
|
"description": "fast mysql driver. Implements core protocol, prepared statements, ssl and compression in native JS (with updated dependencies)",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"typings": "typings/mysql/index",
|
|
@@ -64,11 +64,11 @@
|
|
|
64
64
|
"aws-ssl-profiles": "^1.1.2",
|
|
65
65
|
"denque": "^2.1.0",
|
|
66
66
|
"generate-function": "^2.3.1",
|
|
67
|
-
"iconv-lite": "^0.7.
|
|
67
|
+
"iconv-lite": "^0.7.3",
|
|
68
68
|
"long": "^5.3.2",
|
|
69
69
|
"lru.min": "^1.1.4",
|
|
70
70
|
"named-placeholders": "^1.1.6",
|
|
71
|
-
"sql-escaper": "^1.
|
|
71
|
+
"sql-escaper": "^1.5.1"
|
|
72
72
|
},
|
|
73
73
|
"peerDependencies": {
|
|
74
74
|
"@types/node": ">= 8"
|
|
@@ -82,7 +82,7 @@
|
|
|
82
82
|
"@rollup/plugin-commonjs": "^29.0.2",
|
|
83
83
|
"@rollup/plugin-json": "^6.1.0",
|
|
84
84
|
"@rollup/plugin-node-resolve": "^16.0.3",
|
|
85
|
-
"@types/node": "^
|
|
85
|
+
"@types/node": "^26.0.0",
|
|
86
86
|
"@typescript-eslint/eslint-plugin": "^8.56.0",
|
|
87
87
|
"@typescript-eslint/parser": "^8.56.0",
|
|
88
88
|
"assert-diff": "^3.0.4",
|
|
@@ -101,11 +101,16 @@
|
|
|
101
101
|
"typescript": "^5.9.3"
|
|
102
102
|
},
|
|
103
103
|
"depup": {
|
|
104
|
-
"changes": {
|
|
105
|
-
|
|
104
|
+
"changes": {
|
|
105
|
+
"iconv-lite": {
|
|
106
|
+
"from": "^0.7.2",
|
|
107
|
+
"to": "^0.7.3"
|
|
108
|
+
}
|
|
109
|
+
},
|
|
110
|
+
"depsUpdated": 1,
|
|
106
111
|
"originalPackage": "mysql2",
|
|
107
|
-
"originalVersion": "3.
|
|
108
|
-
"processedAt": "2026-
|
|
112
|
+
"originalVersion": "3.23.2",
|
|
113
|
+
"processedAt": "2026-07-27T16:45:28.701Z",
|
|
109
114
|
"smokeTest": "passed"
|
|
110
115
|
}
|
|
111
116
|
}
|
package/promise.js
CHANGED
|
@@ -9,6 +9,10 @@ const createPool = require('./lib/create_pool.js');
|
|
|
9
9
|
const createPoolCluster = require('./lib/create_pool_cluster.js');
|
|
10
10
|
const PromiseConnection = require('./lib/promise/connection.js');
|
|
11
11
|
const PromisePool = require('./lib/promise/pool.js');
|
|
12
|
+
const {
|
|
13
|
+
captureStackHolder,
|
|
14
|
+
applyCapturedStack,
|
|
15
|
+
} = require('./lib/promise/capture_local_err.js');
|
|
12
16
|
const makeDoneCb = require('./lib/promise/make_done_cb.js');
|
|
13
17
|
const PromisePoolConnection = require('./lib/promise/pool_connection.js');
|
|
14
18
|
const inheritEvents = require('./lib/promise/inherit_events.js');
|
|
@@ -16,6 +20,7 @@ const PromisePoolNamespace = require('./lib/promise/pool_cluster');
|
|
|
16
20
|
|
|
17
21
|
function createConnectionPromise(opts) {
|
|
18
22
|
const coreConnection = createConnection(opts);
|
|
23
|
+
const stackHolder = captureStackHolder(createConnectionPromise);
|
|
19
24
|
const thePromise = opts.Promise || Promise;
|
|
20
25
|
if (!thePromise) {
|
|
21
26
|
throw new Error(
|
|
@@ -29,12 +34,8 @@ function createConnectionPromise(opts) {
|
|
|
29
34
|
resolve(new PromiseConnection(coreConnection, thePromise));
|
|
30
35
|
});
|
|
31
36
|
coreConnection.once('error', (err) => {
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
createConnectionErr.code = err.code;
|
|
35
|
-
createConnectionErr.errno = err.errno;
|
|
36
|
-
createConnectionErr.sqlState = err.sqlState;
|
|
37
|
-
reject(createConnectionErr);
|
|
37
|
+
applyCapturedStack(err, stackHolder);
|
|
38
|
+
reject(err);
|
|
38
39
|
});
|
|
39
40
|
});
|
|
40
41
|
}
|
|
@@ -83,26 +84,30 @@ class PromisePoolCluster extends EventEmitter {
|
|
|
83
84
|
|
|
84
85
|
query(sql, args) {
|
|
85
86
|
const corePoolCluster = this.poolCluster;
|
|
87
|
+
const stackHolder = captureStackHolder(PromisePoolCluster.prototype.query);
|
|
86
88
|
if (typeof args === 'function') {
|
|
87
89
|
throw new Error(
|
|
88
90
|
'Callback function is not available with promise clients.'
|
|
89
91
|
);
|
|
90
92
|
}
|
|
91
93
|
return new this.Promise((resolve, reject) => {
|
|
92
|
-
const done = makeDoneCb(resolve, reject);
|
|
94
|
+
const done = makeDoneCb(resolve, reject, stackHolder);
|
|
93
95
|
corePoolCluster.query(sql, args, done);
|
|
94
96
|
});
|
|
95
97
|
}
|
|
96
98
|
|
|
97
99
|
execute(sql, args) {
|
|
98
100
|
const corePoolCluster = this.poolCluster;
|
|
101
|
+
const stackHolder = captureStackHolder(
|
|
102
|
+
PromisePoolCluster.prototype.execute
|
|
103
|
+
);
|
|
99
104
|
if (typeof args === 'function') {
|
|
100
105
|
throw new Error(
|
|
101
106
|
'Callback function is not available with promise clients.'
|
|
102
107
|
);
|
|
103
108
|
}
|
|
104
109
|
return new this.Promise((resolve, reject) => {
|
|
105
|
-
const done = makeDoneCb(resolve, reject);
|
|
110
|
+
const done = makeDoneCb(resolve, reject, stackHolder);
|
|
106
111
|
corePoolCluster.execute(sql, args, done);
|
|
107
112
|
});
|
|
108
113
|
}
|
|
@@ -116,16 +121,12 @@ class PromisePoolCluster extends EventEmitter {
|
|
|
116
121
|
|
|
117
122
|
end() {
|
|
118
123
|
const corePoolCluster = this.poolCluster;
|
|
124
|
+
const stackHolder = captureStackHolder(PromisePoolCluster.prototype.end);
|
|
119
125
|
return new this.Promise((resolve, reject) => {
|
|
120
126
|
corePoolCluster.end((err) => {
|
|
121
127
|
if (err) {
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
localErr.code = err.code;
|
|
125
|
-
localErr.errno = err.errno;
|
|
126
|
-
localErr.sqlState = err.sqlState;
|
|
127
|
-
localErr.sqlMessage = err.sqlMessage;
|
|
128
|
-
reject(localErr);
|
|
128
|
+
applyCapturedStack(err, stackHolder);
|
|
129
|
+
reject(err);
|
|
129
130
|
} else {
|
|
130
131
|
resolve();
|
|
131
132
|
}
|
|
@@ -220,7 +220,13 @@ export interface ConnectionOptions {
|
|
|
220
220
|
|
|
221
221
|
/**
|
|
222
222
|
* When dealing with big numbers (BIGINT and DECIMAL columns) in the database, you should enable this option
|
|
223
|
-
* (Default: false)
|
|
223
|
+
* (Default: false).
|
|
224
|
+
*
|
|
225
|
+
* Also applies inside parsed JSON columns: integers that cannot be accurately represented with JavaScript
|
|
226
|
+
* Number objects (beyond the [-2^53, +2^53] range) are returned as exact String objects instead of being
|
|
227
|
+
* silently rounded by JSON.parse. Exactness inside JSON requires Node.js 22+ (JSON.parse source access);
|
|
228
|
+
* older runtimes fall back to plain JSON.parse behaviour. Has no effect when jsonStrings is enabled, where
|
|
229
|
+
* the raw JSON text (always exact) is returned instead.
|
|
224
230
|
*/
|
|
225
231
|
supportBigNumbers?: boolean;
|
|
226
232
|
|
|
@@ -40,6 +40,17 @@ export type Type = {
|
|
|
40
40
|
};
|
|
41
41
|
|
|
42
42
|
export type Field = Type & {
|
|
43
|
+
/**
|
|
44
|
+
* MariaDB extended data type name (e.g. `uuid`, `inet4`, `inet6`, `point`),
|
|
45
|
+
* available when the server supports the MARIADB_CLIENT_EXTENDED_METADATA
|
|
46
|
+
* capability (MariaDB 10.5+)
|
|
47
|
+
*/
|
|
48
|
+
extendedTypeName?: string;
|
|
49
|
+
/**
|
|
50
|
+
* MariaDB extended format name (e.g. `json`), available when the server
|
|
51
|
+
* supports the MARIADB_CLIENT_EXTENDED_METADATA capability (MariaDB 10.5+)
|
|
52
|
+
*/
|
|
53
|
+
extendedFormat?: string;
|
|
43
54
|
length: number;
|
|
44
55
|
db: string;
|
|
45
56
|
table: string;
|
|
@@ -22,6 +22,17 @@ declare interface FieldPacket {
|
|
|
22
22
|
typeName?: string;
|
|
23
23
|
encoding?: string;
|
|
24
24
|
columnLength?: number;
|
|
25
|
+
/**
|
|
26
|
+
* MariaDB extended data type name (e.g. `uuid`, `inet4`, `inet6`, `point`),
|
|
27
|
+
* available when the server supports the MARIADB_CLIENT_EXTENDED_METADATA
|
|
28
|
+
* capability (MariaDB 10.5+)
|
|
29
|
+
*/
|
|
30
|
+
extendedTypeName?: string;
|
|
31
|
+
/**
|
|
32
|
+
* MariaDB extended format name (e.g. `json`), available when the server
|
|
33
|
+
* supports the MARIADB_CLIENT_EXTENDED_METADATA capability (MariaDB 10.5+)
|
|
34
|
+
*/
|
|
35
|
+
extendedFormat?: string;
|
|
25
36
|
}
|
|
26
37
|
|
|
27
38
|
export { FieldPacket };
|
|
@@ -122,7 +122,13 @@ export interface QueryOptions {
|
|
|
122
122
|
|
|
123
123
|
/**
|
|
124
124
|
* When dealing with big numbers (BIGINT and DECIMAL columns) in the database, you should enable this option
|
|
125
|
-
* (Default: false)
|
|
125
|
+
* (Default: false).
|
|
126
|
+
*
|
|
127
|
+
* Also applies inside parsed JSON columns: integers that cannot be accurately represented with JavaScript
|
|
128
|
+
* Number objects (beyond the [-2^53, +2^53] range) are returned as exact String objects instead of being
|
|
129
|
+
* silently rounded by JSON.parse. Exactness inside JSON requires Node.js 22+ (JSON.parse source access);
|
|
130
|
+
* older runtimes fall back to plain JSON.parse behaviour. Has no effect when jsonStrings is enabled, where
|
|
131
|
+
* the raw JSON text (always exact) is returned instead.
|
|
126
132
|
*/
|
|
127
133
|
supportBigNumbers?: boolean;
|
|
128
134
|
|