Skip to content

Commit 3a1a8a9

Browse files
committed
Revert different treatment of and .
It generates invalid SQL queries when users accidentally set something to undefined rather than null.
1 parent e953232 commit 3a1a8a9

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

lib/Dialects/postgresql.js

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,9 @@ exports.escapeId = function () {
3030
};
3131

3232
exports.escapeVal = function (val, timeZone) {
33-
if (val === undefined){
34-
return 'DEFAULT';
35-
}else if(val === null){
36-
return 'NULL';
37-
}
33+
if (val === undefined || val === null) {
34+
return 'NULL';
35+
}
3836

3937
if (Array.isArray(val)) {
4038
if (val.length === 1 && Array.isArray(val[0])) {

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"sql",
77
"query"
88
],
9-
"version": "0.1.20",
9+
"version": "0.1.21",
1010
"license": "MIT",
1111
"repository": {
1212
"url": "http://github.com/dresende/node-sql-query"

0 commit comments

Comments
 (0)