This commit is contained in:
2026-07-14 08:12:13 +01:00
parent b5e4724e03
commit 3b5fba4063
26 changed files with 1097 additions and 321 deletions
+5
View File
@@ -1,6 +1,7 @@
import dbHandler from "../db-handler";
import _ from "lodash";
import type {
BunMariaDBConfig,
DBResponseObject,
SQLInsertGenValueType,
ServerQueryParam,
@@ -15,6 +16,7 @@ type Params<
data: Schema;
query?: ServerQueryParam<Schema>;
targetId?: number | string;
config?: BunMariaDBConfig;
};
function quoteIdentifier(identifier: string): string {
@@ -29,6 +31,7 @@ export default async function DbUpdate<
data,
query,
targetId,
config,
}: Params<Schema, Table>): Promise<DBResponseObject> {
let sqlObj: ReturnType<typeof sqlGenerator> = { string: "", values: [] };
@@ -93,6 +96,7 @@ export default async function DbUpdate<
const res = await dbHandler({
query: sql,
values: values as any,
config,
});
sqlObj.string = sql;
@@ -122,6 +126,7 @@ export default async function DbUpdate<
const updated_res = await dbHandler({
query: updated_sql,
values: updated_sql_values,
config,
});
const affected_rows = updated_res.payload?.length;