Fix PostgreSQLDialect escaping of single quotes

This commit is contained in:
Garrett Mills 2022-07-09 11:42:02 -05:00
parent 6ca4bc1151
commit 4d7769de56
2 changed files with 2 additions and 2 deletions

View File

@ -1,6 +1,6 @@
{
"name": "@extollo/lib",
"version": "0.10.4",
"version": "0.10.5",
"description": "The framework library that lifts up your code.",
"main": "lib/index.js",
"types": "lib/index.d.ts",

View File

@ -39,7 +39,7 @@ export class PostgreSQLDialect extends SQLDialect {
} else if ( value === null || typeof value === 'undefined' ) {
return new QuerySafeValue(value, 'NULL')
} else {
const escaped = value.replace(/'/g, '\\\'') // .replace(/"/g, '\\"').replace(/`/g, '\\`')
const escaped = value.replace(/'/g, '\'\'') // .replace(/"/g, '\\"').replace(/`/g, '\\`')
return new QuerySafeValue(value, `'${escaped}'`)
}
}