jspg stabilized again
This commit is contained in:
@ -347,22 +347,23 @@ impl<'a> Compiler<'a> {
|
||||
child_node.schema = Arc::clone(target_schema);
|
||||
child_node.is_polymorphic_branch = true;
|
||||
|
||||
let val_sql = if disc == "kind" && node.parent_type.is_some() && node.parent_type_aliases.is_some() {
|
||||
let val_sql =
|
||||
if disc == "kind" && node.parent_type.is_some() && node.parent_type_aliases.is_some() {
|
||||
let aliases_arc = node.parent_type_aliases.as_ref().unwrap();
|
||||
let aliases = aliases_arc.as_ref();
|
||||
let p_type = node.parent_type.unwrap();
|
||||
|
||||
|
||||
let select_args = self.compile_select_clause(p_type, aliases, child_node.clone())?;
|
||||
|
||||
|
||||
if select_args.is_empty() {
|
||||
"jsonb_build_object()".to_string()
|
||||
"jsonb_build_object()".to_string()
|
||||
} else {
|
||||
format!("jsonb_build_object({})", select_args.join(", "))
|
||||
format!("jsonb_build_object({})", select_args.join(", "))
|
||||
}
|
||||
} else {
|
||||
} else {
|
||||
let (sql, _) = self.compile_node(child_node)?;
|
||||
sql
|
||||
};
|
||||
};
|
||||
|
||||
case_statements.push(format!(
|
||||
"WHEN {}.{} = '{}' THEN ({})",
|
||||
|
||||
Reference in New Issue
Block a user