This commit is contained in:
Benjamin Toby
2025-08-04 08:20:32 +01:00
parent 71a8431de5
commit ab13c68c8e
18 changed files with 41 additions and 20 deletions
@@ -14,6 +14,7 @@ export default function sqlDeleteGenerator({
deleteKeyValues,
dbFullName,
data,
deleteKeyValuesOperator,
}: SQLDeleteGeneratorParams): SQLDeleteGenReturn | undefined {
const finalDbName = dbFullName ? `${dbFullName}.` : "";
@@ -54,7 +55,11 @@ export default function sqlDeleteGenerator({
});
}
queryStr += ` WHERE ${deleteBatch.join(" AND ")}`;
if (deleteBatch.length) {
queryStr += ` WHERE ${deleteBatch.join(
` ${deleteKeyValuesOperator || "AND"} `
)}`;
}
return {
query: queryStr,