Updates
This commit is contained in:
@@ -13,6 +13,7 @@ type Param<T extends {
|
||||
identifierColumnName: keyof T;
|
||||
identifierValue: string | number;
|
||||
forceLocal?: boolean;
|
||||
debug?: boolean;
|
||||
};
|
||||
/**
|
||||
* # Update DB Function
|
||||
@@ -20,5 +21,5 @@ type Param<T extends {
|
||||
*/
|
||||
export default function updateDbEntry<T extends {
|
||||
[k: string]: any;
|
||||
} = any>({ dbContext, dbFullName, tableName, data, tableSchema, identifierColumnName, identifierValue, encryptionKey, encryptionSalt, forceLocal, }: Param<T>): Promise<APIResponseObject<PostInsertReturn>>;
|
||||
} = any>({ dbContext, dbFullName, tableName, data, tableSchema, identifierColumnName, identifierValue, encryptionKey, encryptionSalt, forceLocal, debug, }: Param<T>): Promise<APIResponseObject<PostInsertReturn>>;
|
||||
export {};
|
||||
|
||||
@@ -25,7 +25,7 @@ const purge_default_fields_1 = __importDefault(require("../../../utils/purge-def
|
||||
* @description
|
||||
*/
|
||||
function updateDbEntry(_a) {
|
||||
return __awaiter(this, arguments, void 0, function* ({ dbContext, dbFullName, tableName, data, tableSchema, identifierColumnName, identifierValue, encryptionKey, encryptionSalt, forceLocal, }) {
|
||||
return __awaiter(this, arguments, void 0, function* ({ dbContext, dbFullName, tableName, data, tableSchema, identifierColumnName, identifierValue, encryptionKey, encryptionSalt, forceLocal, debug, }) {
|
||||
var _b;
|
||||
/**
|
||||
* Check if data is valid
|
||||
@@ -139,6 +139,7 @@ function updateDbEntry(_a) {
|
||||
sql: query,
|
||||
params: updateValues,
|
||||
},
|
||||
debug: debug ? { data, newData } : undefined,
|
||||
};
|
||||
});
|
||||
}
|
||||
|
||||
+3
-1
@@ -20,7 +20,7 @@ const addDbEntry_1 = __importDefault(require("../../functions/backend/db/addDbEn
|
||||
const updateDbEntry_1 = __importDefault(require("../../functions/backend/db/updateDbEntry"));
|
||||
function dsqlCrud(params) {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
const { action, data, table, targetValue, sanitize, targetField, targetId, dbFullName, deleteData, batchData, deleteKeyValues, } = params;
|
||||
const { action, data, table, targetValue, sanitize, targetField, targetId, dbFullName, deleteData, batchData, deleteKeyValues, debug, } = params;
|
||||
const finalData = (sanitize ? sanitize({ data }) : data);
|
||||
const finalBatchData = (sanitize ? sanitize({ batchData }) : batchData);
|
||||
const DB_CONN = global.DSQL_READ_ONLY_DB_CONN || global.DSQL_DB_CONN;
|
||||
@@ -35,6 +35,7 @@ function dsqlCrud(params) {
|
||||
batchData: finalBatchData,
|
||||
tableName: table,
|
||||
dbFullName,
|
||||
debug,
|
||||
});
|
||||
return INSERT_RESULT;
|
||||
case "update":
|
||||
@@ -45,6 +46,7 @@ function dsqlCrud(params) {
|
||||
dbFullName,
|
||||
identifierColumnName: (targetField || "id"),
|
||||
identifierValue: String(targetValue || targetId),
|
||||
debug,
|
||||
});
|
||||
return UPDATE_RESULT;
|
||||
case "delete":
|
||||
|
||||
+9
-6
@@ -14,10 +14,13 @@ function setupGlobalNetwork() {
|
||||
(0, child_process_1.execSync)(`docker network rm ${globalNetworkName}`, {});
|
||||
}
|
||||
catch (error) { }
|
||||
let newNtwkCmd = `docker network create`;
|
||||
newNtwkCmd += ` --driver bridge`;
|
||||
newNtwkCmd += ` --subnet ${globalIPPrefix}.0/24`;
|
||||
newNtwkCmd += ` --gateway ${globalIPPrefix}.1`;
|
||||
newNtwkCmd += ` ${globalNetworkName}`;
|
||||
(0, child_process_1.execSync)(newNtwkCmd);
|
||||
try {
|
||||
let newNtwkCmd = `docker network create`;
|
||||
newNtwkCmd += ` --driver bridge`;
|
||||
newNtwkCmd += ` --subnet ${globalIPPrefix}.0/24`;
|
||||
newNtwkCmd += ` --gateway ${globalIPPrefix}.1`;
|
||||
newNtwkCmd += ` ${globalNetworkName}`;
|
||||
(0, child_process_1.execSync)(newNtwkCmd);
|
||||
}
|
||||
catch (error) { }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user