@technicity/data-service-generator 0.14.4 → 0.14.5
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.
|
@@ -118,7 +118,7 @@ function _stringifyWhere(where, table, escapeId, escape, result) {
|
|
|
118
118
|
const operator = keys[0];
|
|
119
119
|
const operand = v[operator];
|
|
120
120
|
if (operator === "$neq") {
|
|
121
|
-
return `${table}.${escapeId(k)} ${getOperatorNeq(
|
|
121
|
+
return `${table}.${escapeId(k)} ${getOperatorNeq(operand)} ${printValue(operand)}`;
|
|
122
122
|
}
|
|
123
123
|
if (operator === "$gt") {
|
|
124
124
|
return `${table}.${escapeId(k)} > ${printValue(operand)}`;
|
|
@@ -59,6 +59,15 @@ const stringifyWhere_1 = require("./stringifyWhere");
|
|
|
59
59
|
});
|
|
60
60
|
strict_1.default.deepEqual(result, "Usr.`userId` != 2 AND Usr.`text` = 'foo'");
|
|
61
61
|
});
|
|
62
|
+
(0, globals_1.test)("should handle $neq null", () => {
|
|
63
|
+
const result = (0, stringifyWhere_1.stringifyWhere)({
|
|
64
|
+
where: { userId: { $neq: null }, text: "foo" },
|
|
65
|
+
table,
|
|
66
|
+
dialect,
|
|
67
|
+
args
|
|
68
|
+
});
|
|
69
|
+
strict_1.default.deepEqual(result, "Usr.`userId` IS NOT NULL AND Usr.`text` = 'foo'");
|
|
70
|
+
});
|
|
62
71
|
(0, globals_1.test)("should handle $gt", () => {
|
|
63
72
|
const result = (0, stringifyWhere_1.stringifyWhere)({
|
|
64
73
|
where: { userId: { $gt: 2 }, text: "foo" },
|