Updates
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user