rado 0.1.54 → 0.1.55
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.
- package/dist/lib/Driver.js +2 -2
- package/dist/lib/Formatter.js +5 -7
- package/package.json +1 -1
package/dist/lib/Driver.js
CHANGED
|
@@ -115,7 +115,7 @@ var SyncDriver = class extends DriverBase {
|
|
|
115
115
|
const res = stmt.all(params).map((row) => JSON.parse(row.result).result);
|
|
116
116
|
if (query.singleResult) {
|
|
117
117
|
const row = res[0];
|
|
118
|
-
if (query.validate &&
|
|
118
|
+
if (query.validate && row === void 0)
|
|
119
119
|
throw new Error("No row found");
|
|
120
120
|
return row;
|
|
121
121
|
}
|
|
@@ -223,7 +223,7 @@ var AsyncDriver = class extends DriverBase {
|
|
|
223
223
|
);
|
|
224
224
|
if (query.singleResult) {
|
|
225
225
|
const row = res[0];
|
|
226
|
-
if (query.validate &&
|
|
226
|
+
if (query.validate && row === void 0)
|
|
227
227
|
throw new Error("No row found");
|
|
228
228
|
return row;
|
|
229
229
|
}
|
package/dist/lib/Formatter.js
CHANGED
|
@@ -118,13 +118,11 @@ var Formatter = class {
|
|
|
118
118
|
stmt.add("UPDATE").addIdentifier(query.table.name).add("SET").space();
|
|
119
119
|
for (const key of stmt.separate(Object.keys(data))) {
|
|
120
120
|
stmt.identifier(key).add("=").space();
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
},
|
|
126
|
-
ExprData.create(data[key])
|
|
127
|
-
);
|
|
121
|
+
const value = data[key];
|
|
122
|
+
if (value instanceof Expr)
|
|
123
|
+
this.formatExprJson(ctx, ExprData.create(data[key]));
|
|
124
|
+
else
|
|
125
|
+
this.formatValue({ ...ctx, formatAsJson: true }, value);
|
|
128
126
|
}
|
|
129
127
|
this.formatWhere(ctx, query.where);
|
|
130
128
|
this.formatLimit(ctx, query);
|