mysql2 3.16.1 → 3.16.2-canary.089a628c

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.
@@ -48,7 +48,6 @@ class ClientHandshake extends Command {
48
48
 
49
49
  sendCredentials(connection) {
50
50
  if (connection.config.debug) {
51
- // eslint-disable-next-line
52
51
  console.log(
53
52
  'Sending handshake packet: flags:%d=(%s)',
54
53
  this.clientFlags,
@@ -111,7 +110,6 @@ class ClientHandshake extends Command {
111
110
  });
112
111
  this.handshake = Packets.Handshake.fromPacket(helloPacket);
113
112
  if (connection.config.debug) {
114
- // eslint-disable-next-line
115
113
  console.log(
116
114
  'Server hello packet: capability flags:%d=(%s)',
117
115
  this.handshake.capabilityFlags,
@@ -39,7 +39,7 @@ class Query extends Command {
39
39
  then() {
40
40
  const err =
41
41
  "You have tried to call .then(), .catch(), or invoked await on the result of query that is not a promise, which is a programming error. Try calling con.promise().query(), or require('mysql2/promise') instead of 'mysql2' for a promise-compatible version of the query interface. To learn how to use async/await or Promises check out documentation at https://sidorares.github.io/node-mysql2/docs#using-promise-wrapper, or the mysql2 documentation at https://sidorares.github.io/node-mysql2/docs/documentation/promise-wrapper";
42
- // eslint-disable-next-line
42
+
43
43
  console.log(err);
44
44
  throw new Error(err);
45
45
  }
@@ -47,7 +47,6 @@ class Query extends Command {
47
47
  /* eslint no-unused-vars: ["error", { "argsIgnorePattern": "^_" }] */
48
48
  start(_packet, connection) {
49
49
  if (connection.config.debug) {
50
- // eslint-disable-next-line
51
50
  console.log(' Sending query command: %s', this.sql);
52
51
  }
53
52
  this._connection = connection;
@@ -119,7 +118,6 @@ class Query extends Command {
119
118
  const rs = new Packets.ResultSetHeader(packet, connection);
120
119
  this._fieldCount = rs.fieldCount;
121
120
  if (connection.config.debug) {
122
- // eslint-disable-next-line
123
121
  console.log(
124
122
  ` Resultset header received, expecting ${rs.fieldCount} column definition packets`
125
123
  );
@@ -201,12 +199,10 @@ class Query extends Command {
201
199
  );
202
200
  this._fields[this._resultIndex].push(field);
203
201
  if (connection.config.debug) {
204
- /* eslint-disable no-console */
205
202
  console.log(' Column definition:');
206
203
  console.log(` name: ${field.name}`);
207
204
  console.log(` type: ${field.columnType}`);
208
205
  console.log(` flags: ${field.flags}`);
209
- /* eslint-enable no-console */
210
206
  }
211
207
  }
212
208
  // last field received
@@ -235,7 +231,6 @@ class Query extends Command {
235
231
  return this.row;
236
232
  }
237
233
 
238
- /* eslint no-unused-vars: ["error", { "argsIgnorePattern": "^_" }] */
239
234
  row(packet, _connection) {
240
235
  if (packet.isEOF()) {
241
236
  const status = packet.eofStatusFlags();
@@ -168,7 +168,6 @@ class ServerHandshake extends Command {
168
168
  if (connection.listeners('packet').length) {
169
169
  connection.emit('packet', packet.clone(), knownCommand, commandCode);
170
170
  } else if (!knownCommand) {
171
- // eslint-disable-next-line no-console
172
171
  console.log('Unknown command:', commandCode);
173
172
  }
174
173
  return ServerHandshake.prototype.dispatchCommands;
@@ -87,7 +87,6 @@ class ConnectionConfig {
87
87
  if (!Object.prototype.hasOwnProperty.call(options, key)) continue;
88
88
  if (validOptions[key] !== 1) {
89
89
  // REVIEW: Should this be emitted somehow?
90
- // eslint-disable-next-line no-console
91
90
  console.error(
92
91
  `Ignoring invalid configuration option passed to Connection: ${key}. This is currently a warning, but in future versions of MySQL2, an error will be thrown if you pass an invalid configuration option to a Connection`
93
92
  );
@@ -131,7 +130,7 @@ class ConnectionConfig {
131
130
  ) {
132
131
  // strictly supports timezones specified by mysqljs/mysql:
133
132
  // https://github.com/mysqljs/mysql#user-content-connection-options
134
- // eslint-disable-next-line no-console
133
+
135
134
  console.error(
136
135
  `Ignoring invalid timezone passed to Connection: ${options.timezone}. This is currently a warning, but in future versions of MySQL2, an error will be thrown if you pass an invalid configuration option to a Connection`
137
136
  );
@@ -282,7 +281,7 @@ class ConnectionConfig {
282
281
  try {
283
282
  // Try to parse this as a JSON expression first
284
283
  options[key] = JSON.parse(value);
285
- } catch (err) {
284
+ } catch {
286
285
  // Otherwise assume it is a plain string
287
286
  options[key] = value;
288
287
  }
package/lib/helpers.js CHANGED
@@ -28,10 +28,9 @@ try {
28
28
  // the purpose of this is to prevent projects using Webpack from displaying a warning during runtime if cardinal is not a dependency
29
29
  const REQUIRE_TERMINATOR = '';
30
30
  highlightFn = require(`cardinal${REQUIRE_TERMINATOR}`).highlight;
31
- } catch (err) {
31
+ } catch {
32
32
  highlightFn = (text) => {
33
33
  if (!cardinalRecommended) {
34
- // eslint-disable-next-line no-console
35
34
  console.log('For nicer debug output consider install cardinal@^2.0.0');
36
35
  cardinalRecommended = true;
37
36
  }
@@ -43,9 +42,7 @@ try {
43
42
  * Prints debug message with code frame, will try to use `cardinal` if available.
44
43
  */
45
44
  function printDebugWithCode(msg, code) {
46
- // eslint-disable-next-line no-console
47
45
  console.log(`\n\n${msg}:\n`);
48
- // eslint-disable-next-line no-console
49
46
  console.log(`${highlightFn(code)}\n`);
50
47
  }
51
48
 
@@ -73,7 +73,6 @@ class Packet {
73
73
  }
74
74
 
75
75
  dump() {
76
- // eslint-disable-next-line no-console
77
76
  console.log(
78
77
  [this.buffer.asciiSlice(this.start, this.end)],
79
78
  this.buffer.slice(this.start, this.end),
@@ -227,7 +226,7 @@ class Packet {
227
226
  res = resNumber.toString() === resString ? resNumber : resString;
228
227
  return bigNumberStrings ? resString : res;
229
228
  }
230
- // eslint-disable-next-line no-console
229
+
231
230
  console.trace();
232
231
  throw new Error(`Should not reach here: ${tag}`);
233
232
  }
@@ -9,10 +9,10 @@ module.exports = function (command, connectionStream) {
9
9
 
10
10
  options = options || {};
11
11
  options.objectMode = true;
12
- (stream = new Readable(options)),
12
+ ((stream = new Readable(options)),
13
13
  (stream._read = function () {
14
14
  connectionStream.resume();
15
- });
15
+ }));
16
16
 
17
17
  this.on('result', (row, i) => {
18
18
  if (!stream.push(row)) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mysql2",
3
- "version": "3.16.1",
3
+ "version": "3.16.2-canary.089a628c",
4
4
  "description": "fast mysql driver. Implements core protocol, prepared statements, ssl and compression in native JS",
5
5
  "main": "index.js",
6
6
  "typings": "typings/mysql/index",
@@ -12,6 +12,12 @@
12
12
  "test:bun": "bun poku -d --sequential test/esm test/unit test/integration",
13
13
  "test:deno": "deno run --allow-read --allow-env --allow-run npm:poku -d --sequential --denoAllow=\"read,env,net,sys\" test/esm test/unit test/integration",
14
14
  "test:tsc-build": "cd \"test/tsc-build\" && npx tsc -p \"tsconfig.json\"",
15
+ "test:docker:up": "docker compose -f test/docker-compose.yml up --abort-on-container-exit --remove-orphans",
16
+ "test:docker:down": "docker compose -f test/docker-compose.yml down",
17
+ "test:docker:node": "npm run test:docker:up -- node && npm run test:docker:down",
18
+ "test:docker:bun": "npm run test:docker:up -- bun && npm run test:docker:down",
19
+ "test:docker:deno": "npm run test:docker:up -- deno && npm run test:docker:down",
20
+ "test:docker:coverage": "npm run test:docker:up -- coverage && npm run test:docker:down",
15
21
  "coverage-test": "c8 npm run test",
16
22
  "benchmark": "node ./benchmarks/benchmark.js",
17
23
  "wait-port": "wait-on"
@@ -46,35 +52,35 @@
46
52
  "author": "Andrey Sidorov <andrey.sidorov@gmail.com>",
47
53
  "license": "MIT",
48
54
  "dependencies": {
49
- "aws-ssl-profiles": "^1.1.1",
55
+ "aws-ssl-profiles": "^1.1.2",
50
56
  "denque": "^2.1.0",
51
57
  "generate-function": "^2.3.1",
52
- "iconv-lite": "^0.7.0",
53
- "long": "^5.2.1",
54
- "lru.min": "^1.0.0",
58
+ "iconv-lite": "^0.7.2",
59
+ "long": "^5.3.2",
60
+ "lru.min": "^1.1.3",
55
61
  "named-placeholders": "^1.1.6",
56
62
  "seq-queue": "^0.0.5",
57
- "sqlstring": "^2.3.2"
63
+ "sqlstring": "^2.3.3"
58
64
  },
59
65
  "devDependencies": {
60
- "@eslint/eslintrc": "^3.3.0",
61
- "@eslint/js": "^9.21.0",
62
- "@eslint/markdown": "^7.0.0",
63
- "@types/node": "^25.0.2",
64
- "@typescript-eslint/eslint-plugin": "^8.26.0",
65
- "@typescript-eslint/parser": "^8.26.0",
66
- "assert-diff": "^3.0.2",
66
+ "@eslint/eslintrc": "^3.3.3",
67
+ "@eslint/js": "^9.39.2",
68
+ "@eslint/markdown": "^7.5.1",
69
+ "@types/node": "^25.0.9",
70
+ "@typescript-eslint/eslint-plugin": "^8.53.0",
71
+ "@typescript-eslint/parser": "^8.53.0",
72
+ "assert-diff": "^3.0.4",
67
73
  "benchmark": "^2.1.4",
68
- "c8": "^10.1.1",
69
- "error-stack-parser": "^2.0.3",
70
- "eslint-config-prettier": "^10.0.2",
74
+ "c8": "^10.1.3",
75
+ "error-stack-parser": "^2.1.4",
76
+ "eslint-config-prettier": "^10.1.8",
71
77
  "eslint-plugin-async-await": "^0.0.0",
72
78
  "eslint-plugin-markdown": "^5.1.0",
73
- "eslint-plugin-prettier": "^5.2.3",
79
+ "eslint-plugin-prettier": "^5.5.5",
74
80
  "globals": "^17.0.0",
75
- "poku": "^3.0.0",
76
- "portfinder": "^1.0.28",
77
- "prettier": "^3.0.0",
78
- "typescript": "^5.0.2"
81
+ "poku": "^3.0.2",
82
+ "portfinder": "^1.0.38",
83
+ "prettier": "^3.8.0",
84
+ "typescript": "^5.9.3"
79
85
  }
80
86
  }