Skip to content

Commit 6bbcc8d

Browse files
committed
Change .escapeId to allow people to forbid qualified identifiers (#342)
1 parent 4d7fb69 commit 6bbcc8d

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

lib/protocol/SqlString.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
var SqlString = exports;
22

3-
SqlString.escapeId = function (val) {
3+
SqlString.escapeId = function (val, forbidQualified) {
4+
if (forbidQualified) {
5+
return '`' + val.replace(/`/g, '``') + '`';
6+
}
47
return '`' + val.replace(/`/g, '``').replace(/\./g, '`.`') + '`';
58
};
69

0 commit comments

Comments
 (0)