修复数据库中反斜杠转义问题

This commit is contained in:
2025-03-13 09:07:58 +08:00
parent c5e5a1e251
commit 1896efa891
3 changed files with 4 additions and 4 deletions

View File

@ -6,7 +6,7 @@ export function escapeID(...keys: string[]) {
export function escapeValue(value: any) {
if (typeof value === "number") return value.toString();
else if (typeof value === "string") return `E'${(value).replaceAll("'", "\\x27")}'`;
else if (typeof value === "string") return `E'${(value).replaceAll("'", "\\x27").replaceAll("\\", "\\x5c")}'`;
else if (typeof value === "boolean") return value.toString();
else if (typeof value === "bigint") return value.toString();
else if (value === null) return "null";