-
Notifications
You must be signed in to change notification settings - Fork 19
Open
Labels
bugSomething isn't workingSomething isn't working
Description
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')}'`;
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working
Projects
Status
Triage