jspg stabilized again

This commit is contained in:
2026-04-15 03:08:11 -04:00
parent c38d81efa4
commit a3bd79deef
7 changed files with 3852 additions and 3379 deletions

View File

@ -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 ({})",