mysql2 3.6.2 → 3.6.4
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.
|
@@ -137,7 +137,7 @@ class ClientHandshake extends Command {
|
|
|
137
137
|
if (connection.config.ssl) {
|
|
138
138
|
// client requires SSL but server does not support it
|
|
139
139
|
if (!serverSSLSupport) {
|
|
140
|
-
const err = new Error('Server does not support secure
|
|
140
|
+
const err = new Error('Server does not support secure connection');
|
|
141
141
|
err.code = 'HANDSHAKE_NO_SSL_SUPPORT';
|
|
142
142
|
err.fatal = true;
|
|
143
143
|
this.emit('error', err);
|
package/lib/connection.js
CHANGED
|
@@ -623,7 +623,8 @@ class Connection extends EventEmitter {
|
|
|
623
623
|
options = {
|
|
624
624
|
...options,
|
|
625
625
|
...sql,
|
|
626
|
-
sql: sql.sql
|
|
626
|
+
sql: sql.sql,
|
|
627
|
+
values: sql.values
|
|
627
628
|
};
|
|
628
629
|
if (typeof values === 'function') {
|
|
629
630
|
cb = values;
|
|
@@ -913,7 +914,8 @@ class Connection extends EventEmitter {
|
|
|
913
914
|
options = {
|
|
914
915
|
...options,
|
|
915
916
|
...sql,
|
|
916
|
-
sql: sql.sql
|
|
917
|
+
sql: sql.sql,
|
|
918
|
+
values: sql.values
|
|
917
919
|
};
|
|
918
920
|
if (typeof values === 'function') {
|
|
919
921
|
cb = values;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "mysql2",
|
|
3
|
-
"version": "3.6.
|
|
3
|
+
"version": "3.6.4",
|
|
4
4
|
"description": "fast mysql driver. Implements core protocol, prepared statements, ssl and compression in native JS",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"directories": {
|
|
@@ -79,7 +79,7 @@
|
|
|
79
79
|
"eslint-plugin-async-await": "0.0.0",
|
|
80
80
|
"eslint-plugin-markdown": "^3.0.0",
|
|
81
81
|
"husky": "^8.0.2",
|
|
82
|
-
"lint-staged": "^
|
|
82
|
+
"lint-staged": "^15.0.1",
|
|
83
83
|
"portfinder": "^1.0.28",
|
|
84
84
|
"prettier": "^3.0.0",
|
|
85
85
|
"progress": "^2.0.3",
|
|
@@ -258,6 +258,16 @@ export interface ConnectionOptions {
|
|
|
258
258
|
*/
|
|
259
259
|
rowsAsArray?: boolean;
|
|
260
260
|
|
|
261
|
+
/**
|
|
262
|
+
* Enable keep-alive on the socket. (Default: true)
|
|
263
|
+
*/
|
|
264
|
+
enableKeepAlive?: boolean;
|
|
265
|
+
|
|
266
|
+
/**
|
|
267
|
+
* If keep-alive is enabled users can supply an initial delay. (Default: 0)
|
|
268
|
+
*/
|
|
269
|
+
keepAliveInitialDelay?: number;
|
|
270
|
+
|
|
261
271
|
charsetNumber?: number;
|
|
262
272
|
|
|
263
273
|
compress?: boolean;
|
|
@@ -312,10 +322,14 @@ declare class Connection extends QueryableBase(ExecutableBase(EventEmitter)) {
|
|
|
312
322
|
| RowDataPacket[]
|
|
313
323
|
| OkPacket
|
|
314
324
|
| OkPacket[]
|
|
315
|
-
| ResultSetHeader
|
|
325
|
+
| ResultSetHeader,
|
|
316
326
|
>(
|
|
317
327
|
sql: string,
|
|
318
|
-
callback?: (
|
|
328
|
+
callback?: (
|
|
329
|
+
err: QueryError | null,
|
|
330
|
+
result: T,
|
|
331
|
+
fields: FieldPacket[],
|
|
332
|
+
) => any,
|
|
319
333
|
): Query;
|
|
320
334
|
static createQuery<
|
|
321
335
|
T extends
|
|
@@ -323,11 +337,15 @@ declare class Connection extends QueryableBase(ExecutableBase(EventEmitter)) {
|
|
|
323
337
|
| RowDataPacket[]
|
|
324
338
|
| OkPacket
|
|
325
339
|
| OkPacket[]
|
|
326
|
-
| ResultSetHeader
|
|
340
|
+
| ResultSetHeader,
|
|
327
341
|
>(
|
|
328
342
|
sql: string,
|
|
329
343
|
values: any | any[] | { [param: string]: any },
|
|
330
|
-
callback?: (
|
|
344
|
+
callback?: (
|
|
345
|
+
err: QueryError | null,
|
|
346
|
+
result: T,
|
|
347
|
+
fields: FieldPacket[],
|
|
348
|
+
) => any,
|
|
331
349
|
): Query;
|
|
332
350
|
|
|
333
351
|
beginTransaction(callback: (err: QueryError | null) => void): void;
|
|
@@ -338,7 +356,7 @@ declare class Connection extends QueryableBase(ExecutableBase(EventEmitter)) {
|
|
|
338
356
|
|
|
339
357
|
changeUser(
|
|
340
358
|
options: ConnectionOptions,
|
|
341
|
-
callback?: (err: QueryError | null) => void
|
|
359
|
+
callback?: (err: QueryError | null) => void,
|
|
342
360
|
): void;
|
|
343
361
|
|
|
344
362
|
end(callback?: (err: QueryError | null) => void): void;
|
|
@@ -363,7 +381,7 @@ declare class Connection extends QueryableBase(ExecutableBase(EventEmitter)) {
|
|
|
363
381
|
|
|
364
382
|
prepare(
|
|
365
383
|
sql: string,
|
|
366
|
-
callback?: (err: QueryError | null, statement: PrepareStatementInfo) => any
|
|
384
|
+
callback?: (err: QueryError | null, statement: PrepareStatementInfo) => any,
|
|
367
385
|
): Prepare;
|
|
368
386
|
|
|
369
387
|
unprepare(sql: string): PrepareStatementInfo;
|
|
@@ -37,16 +37,6 @@ export interface PoolOptions extends ConnectionOptions {
|
|
|
37
37
|
* is no limit to the number of queued connection requests. (Default: 0)
|
|
38
38
|
*/
|
|
39
39
|
queueLimit?: number;
|
|
40
|
-
|
|
41
|
-
/**
|
|
42
|
-
* Enable keep-alive on the socket. (Default: true)
|
|
43
|
-
*/
|
|
44
|
-
enableKeepAlive?: boolean;
|
|
45
|
-
|
|
46
|
-
/**
|
|
47
|
-
* If keep-alive is enabled users can supply an initial delay. (Default: 0)
|
|
48
|
-
*/
|
|
49
|
-
keepAliveInitialDelay?: number;
|
|
50
40
|
}
|
|
51
41
|
|
|
52
42
|
declare class Pool extends QueryableBase(ExecutableBase(EventEmitter)) {
|
|
@@ -3,19 +3,25 @@ declare interface FieldPacket {
|
|
|
3
3
|
name: 'FieldPacket';
|
|
4
4
|
};
|
|
5
5
|
catalog: string;
|
|
6
|
-
charsetNr
|
|
7
|
-
db
|
|
6
|
+
charsetNr?: number;
|
|
7
|
+
db?: string;
|
|
8
|
+
schema?: string;
|
|
9
|
+
characterSet?: number;
|
|
8
10
|
decimals: number;
|
|
9
|
-
default
|
|
10
|
-
flags: number;
|
|
11
|
-
length
|
|
11
|
+
default?: any;
|
|
12
|
+
flags: number | string[];
|
|
13
|
+
length?: number;
|
|
12
14
|
name: string;
|
|
13
15
|
orgName: string;
|
|
14
16
|
orgTable: string;
|
|
15
|
-
protocol41
|
|
17
|
+
protocol41?: boolean;
|
|
16
18
|
table: string;
|
|
17
|
-
type
|
|
18
|
-
|
|
19
|
+
type?: number;
|
|
20
|
+
columnType?: number
|
|
21
|
+
zerofill?: boolean;
|
|
22
|
+
typeName?: string;
|
|
23
|
+
encoding?: string;
|
|
24
|
+
columnLength?: number;
|
|
19
25
|
}
|
|
20
26
|
|
|
21
27
|
export { FieldPacket };
|