Skip to content

Commit

Permalink
Align table aliases with examples in comments
Browse files Browse the repository at this point in the history
  • Loading branch information
kamilkisiela committed Jun 20, 2022
1 parent f00526f commit 7305f53
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions store/postgres/src/relational_queries.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1008,15 +1008,15 @@ impl<'a> QueryFilter<'a> {
let parent_column = self.table.primary_key();

if child_column.is_list() {
// Type A: p.id = any(c.{parent_field})
// Type A: c.id = any(i.{parent_field})
out.push_sql(parent_prefix);
out.push_identifier(parent_column.name.as_str())?;
out.push_sql(" = any(");
out.push_sql(child_prefix);
out.push_identifier(child_column.name.as_str())?;
out.push_sql(")");
} else {
// Type B: p.id = c.{parent_field}
// Type B: c.id = i.{parent_field}
out.push_sql(parent_prefix);
out.push_identifier(parent_column.name.as_str())?;
out.push_sql(" = ");
Expand All @@ -1034,15 +1034,15 @@ impl<'a> QueryFilter<'a> {
let child_column = child_table.primary_key();

if parent_column.is_list() {
// Type C: c.id = any(p.child_ids)
// Type C: i.id = any(c.child_ids)
out.push_sql(child_prefix);
out.push_identifier(child_column.name.as_str())?;
out.push_sql(" = any(");
out.push_sql(parent_prefix);
out.push_identifier(parent_column.name.as_str())?;
out.push_sql(")");
} else {
// Type D: c.id = p.child_id
// Type D: i.id = c.child_id
out.push_sql(child_prefix);
out.push_identifier(child_column.name.as_str())?;
out.push_sql(" = ");
Expand Down

0 comments on commit 7305f53

Please sign in to comment.