Skip to content

Commit

Permalink
wip move later join inside
Browse files Browse the repository at this point in the history
  • Loading branch information
aqrln committed Dec 11, 2023
1 parent 9a61410 commit 56e5e1c
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,9 @@ impl SelectBuilder {
}));
}

// LEFT JOIN LATERAL () AS <root_alias> ON TRUE
let root = self.with_related_queries(root, rs.relations(), inner_root_table_alias, ctx);

let root_as_json = match ctx.supports_row_to_json_fn {
true => row_to_json(root_alias.to_table_string(), false),
false => build_json_obj_fn(rs, ctx, root_alias),
Expand All @@ -123,9 +126,6 @@ impl SelectBuilder {
let inner = Select::from_table(Table::from(root).alias(root_alias.to_table_string()))
.value(root_as_json.alias(JSON_AGG_IDENT));

// LEFT JOIN LATERAL () AS <inner_alias> ON TRUE
let inner = self.with_related_queries(inner, rs.relations(), root_alias, ctx);

let linking_fields = rs.field.related_field().linking_fields();

if rs.field.relation().is_many_to_many() {
Expand Down

0 comments on commit 56e5e1c

Please sign in to comment.