db-crud-api 0.3.31 → 0.3.32
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/lib/db-operations.js +12 -12
- package/package.json +1 -1
package/lib/db-operations.js
CHANGED
|
@@ -134,7 +134,7 @@ export function testConnection() {
|
|
|
134
134
|
|
|
135
135
|
export function toStringValue(value) {
|
|
136
136
|
if (!value) return 'null';
|
|
137
|
-
if (value.trimStart().charAt(0) === '\'') return value;
|
|
137
|
+
if (typeof value === 'string' && value.trimStart().charAt(0) === '\'') return value;
|
|
138
138
|
return `\'${value}\'`;
|
|
139
139
|
}
|
|
140
140
|
|
|
@@ -312,7 +312,7 @@ export function preparePatch(tSchema, connection, reqOpe) {
|
|
|
312
312
|
params: _ope.patch.params
|
|
313
313
|
},
|
|
314
314
|
connection: connection,
|
|
315
|
-
appLog: _ope
|
|
315
|
+
appLog: _ope?.hasOwnProperty('appLog') ? _ope.appLog : undefined
|
|
316
316
|
});
|
|
317
317
|
}
|
|
318
318
|
else throw new Error('Request sintax error, missing "patch" property.');
|
|
@@ -337,7 +337,7 @@ export function preparePatchById(tSchema, connection, reqOpe, idValue) {
|
|
|
337
337
|
filters: _filters
|
|
338
338
|
},
|
|
339
339
|
connection: connection,
|
|
340
|
-
appLog: reqOpe
|
|
340
|
+
appLog: reqOpe?.hasOwnProperty('appLog') ? reqOpe.appLog : undefined
|
|
341
341
|
}
|
|
342
342
|
};
|
|
343
343
|
|
|
@@ -356,7 +356,7 @@ export function preparePut(tSchema, connection, reqOpe) {
|
|
|
356
356
|
params: _ope.put.params
|
|
357
357
|
},
|
|
358
358
|
connection: connection,
|
|
359
|
-
appLog: _ope
|
|
359
|
+
appLog: _ope?.hasOwnProperty('appLog') ? _ope.appLog : undefined
|
|
360
360
|
});
|
|
361
361
|
}
|
|
362
362
|
else throw new Error('Request sintax error, missing "put" property.');
|
|
@@ -377,7 +377,7 @@ export function preparePutById(tSchema, connection, reqOpe, idValue) {
|
|
|
377
377
|
params: reqOpe.put.params
|
|
378
378
|
},
|
|
379
379
|
connection: connection,
|
|
380
|
-
appLog: reqOpe
|
|
380
|
+
appLog: reqOpe?.hasOwnProperty('appLog') ? reqOpe.appLog : undefined
|
|
381
381
|
}
|
|
382
382
|
};
|
|
383
383
|
|
|
@@ -395,7 +395,7 @@ export function prepareDelete(tSchema, connection, reqOpe) {
|
|
|
395
395
|
params: _ope.delete.params
|
|
396
396
|
},
|
|
397
397
|
connection: connection,
|
|
398
|
-
appLog: _ope
|
|
398
|
+
appLog: _ope?.hasOwnProperty('appLog') ? _ope.appLog : undefined
|
|
399
399
|
});
|
|
400
400
|
}
|
|
401
401
|
else throw new Error('Request sintax error, missing "delete" property.');
|
|
@@ -412,7 +412,7 @@ export function prepareDeleteById(tSchema, connection, reqOpe, idValue) {
|
|
|
412
412
|
filters: [idField(tSchema) + ' = ' + toStringValue(idValue)]
|
|
413
413
|
},
|
|
414
414
|
connection: connection,
|
|
415
|
-
appLog: reqOpe
|
|
415
|
+
appLog: reqOpe?.hasOwnProperty('appLog') ? reqOpe.appLog : undefined
|
|
416
416
|
}
|
|
417
417
|
};
|
|
418
418
|
|
|
@@ -429,7 +429,7 @@ export function prepareExecute(pSchema, connection, reqOpe) {
|
|
|
429
429
|
params: _ope.execute?.params
|
|
430
430
|
},
|
|
431
431
|
connection: connection,
|
|
432
|
-
appLog: _ope
|
|
432
|
+
appLog: _ope?.hasOwnProperty('appLog') ? _ope.appLog : undefined
|
|
433
433
|
});
|
|
434
434
|
});
|
|
435
435
|
if (_result.length > 1) return _result;
|
|
@@ -451,7 +451,7 @@ export function preparePassthrough(connection, reqOpe) {
|
|
|
451
451
|
params: _ope.passthrough.params
|
|
452
452
|
},
|
|
453
453
|
connection: connection,
|
|
454
|
-
appLog: _ope
|
|
454
|
+
appLog: _ope?.hasOwnProperty('appLog') ? _ope.appLog : undefined
|
|
455
455
|
});
|
|
456
456
|
}
|
|
457
457
|
else throw new Error('Request sintax error, missing "passthrough" property.');
|
|
@@ -465,7 +465,7 @@ export function prepareBegin(connection, reqOpe) {
|
|
|
465
465
|
return {
|
|
466
466
|
begin: {},
|
|
467
467
|
connection: connection,
|
|
468
|
-
appLog: reqOpe
|
|
468
|
+
appLog: reqOpe?.hasOwnProperty('appLog') ? reqOpe.appLog : undefined
|
|
469
469
|
}
|
|
470
470
|
};
|
|
471
471
|
|
|
@@ -473,7 +473,7 @@ export function prepareCommit(connection, reqOpe) {
|
|
|
473
473
|
return {
|
|
474
474
|
commit: {},
|
|
475
475
|
connection: connection,
|
|
476
|
-
appLog: reqOpe
|
|
476
|
+
appLog: reqOpe?.hasOwnProperty('appLog') ? reqOpe.appLog : undefined
|
|
477
477
|
}
|
|
478
478
|
};
|
|
479
479
|
|
|
@@ -481,6 +481,6 @@ export function prepareRollback(connection, reqOpe) {
|
|
|
481
481
|
return {
|
|
482
482
|
rollback: {},
|
|
483
483
|
connection: connection,
|
|
484
|
-
appLog: reqOpe
|
|
484
|
+
appLog: reqOpe?.hasOwnProperty('appLog') ? reqOpe.appLog : undefined
|
|
485
485
|
}
|
|
486
486
|
};
|