mysql2 3.16.3 → 3.17.1

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- const SqlString = require('sqlstring');
3
+ const SqlString = require('sql-escaper');
4
4
 
5
5
  const ConnectionConfig = require('./lib/connection_config.js');
6
6
  const parserCache = require('./lib/parsers/parser_cache.js');
@@ -21,7 +21,7 @@ const Timers = require('timers');
21
21
  const EventEmitter = require('events').EventEmitter;
22
22
  const Readable = require('stream').Readable;
23
23
  const Queue = require('denque');
24
- const SqlString = require('sqlstring');
24
+ const SqlString = require('sql-escaper');
25
25
  const { createLRU } = require('lru.min');
26
26
  const PacketParser = require('../packet_parser.js');
27
27
  const Packets = require('../packets/index.js');
package/lib/base/pool.js CHANGED
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
 
3
3
  const process = require('process');
4
- const SqlString = require('sqlstring');
4
+ const SqlString = require('sql-escaper');
5
5
  const EventEmitter = require('events').EventEmitter;
6
6
  const PoolConnection = require('../pool_connection.js');
7
7
  const Queue = require('denque');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mysql2",
3
- "version": "3.16.3",
3
+ "version": "3.17.1",
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",
@@ -60,7 +60,7 @@
60
60
  "lru.min": "^1.1.3",
61
61
  "named-placeholders": "^1.1.6",
62
62
  "seq-queue": "^0.0.5",
63
- "sqlstring": "^2.3.3"
63
+ "sql-escaper": "^1.3.2"
64
64
  },
65
65
  "devDependencies": {
66
66
  "@eslint/eslintrc": "^3.3.3",
package/promise.js CHANGED
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- const SqlString = require('sqlstring');
3
+ const SqlString = require('sql-escaper');
4
4
  const EventEmitter = require('events').EventEmitter;
5
5
  const parserCache = require('./lib/parsers/parser_cache.js');
6
6
  const PoolCluster = require('./lib/pool_cluster.js');
@@ -1,6 +1,3 @@
1
- /**
2
- * sqlstring types are based on https://www.npmjs.com/package/@types/sqlstring, version 2.3.2
3
- */
4
1
  import { Pool as BasePool, PoolOptions } from './lib/Pool.js';
5
2
  import {
6
3
  Connection as BaseConnection,
@@ -23,6 +20,13 @@ import {
23
20
  PrepareStatementInfo,
24
21
  } from './lib/protocol/sequences/Prepare.js';
25
22
  import { Server } from './lib/Server.js';
23
+ import {
24
+ escape as SqlStringEscape,
25
+ escapeId as SqlStringEscapeId,
26
+ format as SqlStringFormat,
27
+ raw as SqlStringRaw,
28
+ } from 'sql-escaper';
29
+ export type { Raw, SqlValue, Timezone } from 'sql-escaper';
26
30
 
27
31
  export {
28
32
  ConnectionOptions,
@@ -57,26 +61,10 @@ export function createPool(config: PoolOptions): BasePool;
57
61
 
58
62
  export function createPoolCluster(config?: PoolClusterOptions): PoolCluster;
59
63
 
60
- type TimeZone = 'local' | 'Z' | (string & NonNullable<unknown>);
61
- export function escape(
62
- value: any,
63
- stringifyObjects?: boolean,
64
- timeZone?: TimeZone
65
- ): string;
66
-
67
- export function escapeId(value: any, forbidQualified?: boolean): string;
68
-
69
- export function format(sql: string): string;
70
- export function format(
71
- sql: string,
72
- values: any | any[],
73
- stringifyObjects?: boolean,
74
- timeZone?: TimeZone
75
- ): string;
76
-
77
- export function raw(sql: string): {
78
- toSqlString: () => string;
79
- };
64
+ export const escape: typeof SqlStringEscape;
65
+ export const escapeId: typeof SqlStringEscapeId;
66
+ export const format: typeof SqlStringFormat;
67
+ export const raw: typeof SqlStringRaw;
80
68
 
81
69
  export interface ConnectionConfig extends ConnectionOptions {
82
70
  mergeFlags(defaultFlags: string[], userFlags: string[] | string): number;