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
+8 -1
View File
@@ -1,6 +1,10 @@
import dbHandler from "../db-handler";
import _ from "lodash";
import type { DBResponseObject, ServerQueryParam } from "../../types";
import type {
BunMariaDBConfig,
DBResponseObject,
ServerQueryParam,
} from "../../types";
import sqlGenerator from "../../utils/sql-generator";
type Params<
@@ -10,6 +14,7 @@ type Params<
table: Table;
query?: ServerQueryParam<Schema>;
targetId?: number | string;
config?: BunMariaDBConfig;
};
function quoteIdentifier(identifier: string): string {
@@ -23,6 +28,7 @@ export default async function DbDelete<
table,
query,
targetId,
config,
}: Params<Schema, Table>): Promise<DBResponseObject> {
let sqlObj: ReturnType<typeof sqlGenerator> | null = null;
@@ -66,6 +72,7 @@ export default async function DbDelete<
const res = await dbHandler({
query: sql,
values: sqlObj.values as any,
config,
});
if (!res.success) {