Skip to content

Commit a771cae

Browse files
committed
Add "interpreting" parser
1 parent 50e47fa commit a771cae

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

lib/connection_config.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ const validOptions = {
5959
typeCast: 1,
6060
uri: 1,
6161
user: 1,
62+
useStaticParser: 1,
6263
// These options are used for Pool
6364
connectionLimit: 1,
6465
maxIdle: 1,
@@ -147,6 +148,7 @@ class ConnectionConfig {
147148
this.nestTables =
148149
options.nestTables === undefined ? undefined : options.nestTables;
149150
this.typeCast = options.typeCast === undefined ? true : options.typeCast;
151+
this.useStaticParser = options.useStaticParser || false;
150152
if (this.timezone[0] === ' ') {
151153
// "+" is a url encoded char for space so it
152154
// gets translated to space when giving a

lib/parsers/static_text_parser.js

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@
33
const Types = require('../constants/types.js');
44
const Charsets = require('../constants/charsets.js');
55
const helpers = require('../helpers');
6-
const genFunc = require('generate-function');
7-
const parserCache = require('./parser_cache.js');
86

97
const typeNames = [];
108
for (const t in Types) {
@@ -34,8 +32,6 @@ function readField({ packet, type, charset, encoding, config, options }) {
3432
case Types.DOUBLE:
3533
return packet.parseLengthCodedFloat();
3634
case Types.NULL:
37-
// case Types.BIT:
38-
// return 'packet.readBuffer(2)[1]';
3935
case Types.DECIMAL:
4036
case Types.NEWDECIMAL:
4137
if (config.decimalNumbers) {

typings/mysql/lib/Connection.d.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -323,6 +323,8 @@ export interface ConnectionOptions {
323323

324324
waitForConnections?: boolean;
325325

326+
useStaticParser?: boolean;
327+
326328
authPlugins?: {
327329
[key: string]: AuthPlugin;
328330
};

0 commit comments

Comments
 (0)