This commit is contained in:
2025-12-26 09:13:47 +01:00
parent b02399c64d
commit d7cef41552
25 changed files with 68 additions and 51 deletions
+7
View File
@@ -97,6 +97,13 @@ function default_1(_a) {
return {
success: isSuccess,
payload: isSuccess ? (countOnly ? null : parsedRes) : null,
singleRes: isSuccess
? countOnly
? null
: Array.isArray(parsedRes) && parsedRes.length == 1
? parsedRes[0]
: null
: null,
batchPayload: isSuccess ? (countOnly ? null : parsedBatchRes) : null,
error: isSuccess
? undefined
+4 -1
View File
@@ -23,6 +23,7 @@ const sql_generator_1 = __importDefault(require("../../functions/dsql/sql/sql-ge
const deleteDbEntry_1 = __importDefault(require("../../functions/backend/db/deleteDbEntry"));
function dsqlCrud(params) {
return __awaiter(this, void 0, void 0, function* () {
var _a;
const { action, data, table, targetValue, sanitize, targetField, targetId, dbFullName, deleteData, batchData, deleteKeyValues, debug, tableSchema, deleteKeyValuesOperator, dbConfig, query, } = params;
const finalData = (sanitize ? sanitize({ data }) : data);
const finalBatchData = (sanitize ? sanitize({ batchData }) : batchData);
@@ -33,7 +34,9 @@ function dsqlCrud(params) {
dbFullName,
})
: undefined;
const whereClause = queryObject === null || queryObject === void 0 ? void 0 : queryObject.string.replace(/^.*?( WHERE )/, "$1");
const whereClause = ((_a = queryObject === null || queryObject === void 0 ? void 0 : queryObject.string) === null || _a === void 0 ? void 0 : _a.match(/ WHERE /))
? queryObject.string.replace(/^.*?( WHERE )/, "$1")
: undefined;
const whereClauseObject = whereClause
? {
clause: whereClause,