unbreak ::text for json in pg (#4722)
* unbreak ::text for json in pg * better error handling
This commit is contained in:
@@ -583,6 +583,11 @@ fn convert_val(
|
||||
.unwrap_or(vec![]);
|
||||
Ok(Box::new(bytes))
|
||||
}
|
||||
Value::Object(_) if arg_t == "text" || arg_t == "varchar" => {
|
||||
Ok(Box::new(serde_json::to_string(value).map_err(|err| {
|
||||
Error::ExecutionErr(format!("Failed to convert JSON to text: {}", err))
|
||||
})?))
|
||||
}
|
||||
Value::Object(_) => Ok(Box::new(value.clone())),
|
||||
Value::String(s) => Ok(Box::new(s.clone())),
|
||||
_ => Err(Error::ExecutionErr(format!(
|
||||
|
||||
Reference in New Issue
Block a user