This commit is contained in:
Benjamin Toby
2025-02-12 12:39:02 +01:00
parent 12296a3e75
commit b578843c6d
33 changed files with 112 additions and 39 deletions
+9 -6
View File
@@ -2,7 +2,6 @@ import get from "../../actions/get";
import post from "../../actions/post";
import sqlGenerator from "../../functions/dsql/sql/sql-generator";
import { DsqlCrudParam, PostReturn } from "../../types";
import connDbHandler from "../db/conn-db-handler";
export default async function dsqlCrud<
T extends { [key: string]: any } = { [key: string]: any }
@@ -31,11 +30,12 @@ export default async function dsqlCrud<
genObject: query,
});
const GET_RES = await connDbHandler(
global.DSQL_DB_CONN,
queryObject?.string || "",
queryObject?.values || []
);
const GET_RES = await get({
query: queryObject?.string || "",
queryValues: queryObject?.values || [],
debug,
forceLocal: true,
});
return { ...GET_RES, queryObject };
@@ -46,6 +46,7 @@ export default async function dsqlCrud<
table,
data: finalData,
},
forceLocal: true,
});
case "update":
@@ -59,6 +60,7 @@ export default async function dsqlCrud<
identifierValue: String(finalId),
data: finalData,
},
forceLocal: true,
});
case "delete":
@@ -69,6 +71,7 @@ export default async function dsqlCrud<
identifierColumnName: "id",
identifierValue: String(finalId),
},
forceLocal: true,
});
default: