You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In sqlScriptGenerator.js, BYTEA type will fall back to default user type and result in the error "value.replace is not a function".
case "U": {
//USER TYPE
switch (dataTypeName) {
case "jsonb":
case "json":
return `'${JSON.stringify(value).replace(/'/g, "''")}'`;
case "bytea":
console.log(value.toString('hex'));
return `'\\x${value.toString('hex')}'`;
default:
//like XML, UUID, GEOMETRY, etc.
return `'${value.replace(/'/g, "''")}'`;
}
``
`It could be fixed by a change like this.
case "U": {
//USER TYPE
switch (dataTypeName) {
case "jsonb":
case "json":
return `'${JSON.stringify(value).replace(/'/g, "''")}'`;
case "bytea":
return `'\\x${value.toString('hex')}'`;
The text was updated successfully, but these errors were encountered:
zxli
changed the title
Need support BYTEA type for data comparison...
Need support for BYTEA type for data comparison...
Apr 3, 2024
Sure I missed something because the default case must remain, but in the code that you mentioned the case "bytea" is there, so it should not land in the default case.
In sqlScriptGenerator.js, BYTEA type will fall back to default user type and result in the error "value.replace is not a function".
The text was updated successfully, but these errors were encountered: