Skip to content

Commit ec00429

Browse files
committed
lib: Log a deprecation message when a {__raw: ...} object is used
1 parent 774b9d3 commit ec00429

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

lib/MySQLTable.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
'use strict';
22

3+
const util = require('util');
4+
5+
const returnDeprecatedRaw = util.deprecate(
6+
raw => raw,
7+
'[mysql-plus] {__raw: ...} objects are deprected and will not be supported starting in v0.14.0.'
8+
);
9+
310
/**
411
* A class that provides convenient methods for performing queries.<br>To create
512
* an instance, use {@link PoolPlus#defineTable|`poolPlus.defineTable()`} or
@@ -462,7 +469,7 @@ class MySQLTable {
462469

463470
_rawEscape(value) {
464471
return value && value.__raw !== undefined
465-
? value.__raw
472+
? returnDeprecatedRaw(value.__raw)
466473
: this._db.escape(value);
467474
}
468475
}

0 commit comments

Comments
 (0)