feat(bots/discord): sanitize BasicDatabase inputs

This commit is contained in:
PalmDevs
2024-03-29 20:12:44 +07:00
parent 0b55d1228f
commit fd76e0af72

View File

@@ -52,7 +52,7 @@ export class BasicDatabase<T extends Record<string, BasicSQLBindings>> {
}
#encodeValue(value: unknown) {
if (typeof value === 'string') return `'${value}'`
if (typeof value === 'string') return `'${value.replaceAll("'", "\\'")}'`
if (typeof value === 'number') return value
if (typeof value === 'boolean') return value ? 1 : 0
if (value === null) return 'NULL'