Fix PostgreSQLDialect escaping of single quotes
This commit is contained in:
parent
6ca4bc1151
commit
4d7769de56
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@extollo/lib",
|
"name": "@extollo/lib",
|
||||||
"version": "0.10.4",
|
"version": "0.10.5",
|
||||||
"description": "The framework library that lifts up your code.",
|
"description": "The framework library that lifts up your code.",
|
||||||
"main": "lib/index.js",
|
"main": "lib/index.js",
|
||||||
"types": "lib/index.d.ts",
|
"types": "lib/index.d.ts",
|
||||||
|
@ -39,7 +39,7 @@ export class PostgreSQLDialect extends SQLDialect {
|
|||||||
} else if ( value === null || typeof value === 'undefined' ) {
|
} else if ( value === null || typeof value === 'undefined' ) {
|
||||||
return new QuerySafeValue(value, 'NULL')
|
return new QuerySafeValue(value, 'NULL')
|
||||||
} else {
|
} else {
|
||||||
const escaped = value.replace(/'/g, '\\\'') // .replace(/"/g, '\\"').replace(/`/g, '\\`')
|
const escaped = value.replace(/'/g, '\'\'') // .replace(/"/g, '\\"').replace(/`/g, '\\`')
|
||||||
return new QuerySafeValue(value, `'${escaped}'`)
|
return new QuerySafeValue(value, `'${escaped}'`)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user