MCPcopy Create free account
hub / github.com/clockworklabs/SpacetimeDB / build

Method build

crates/query-builder/src/join.rs:171–189  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

169 }
170
171 pub fn build(self) -> RawQuery<L> {
172 let where_clause = self
173 .where_expr
174 .map(|e| format!(" WHERE {}", format_expr(&e)))
175 .unwrap_or_default();
176
177 let sql = format!(
178 r#"SELECT "{}".* FROM "{}" JOIN "{}" ON "{}"."{}" = "{}"."{}"{}"#,
179 self.left_col.table_name(),
180 self.left_col.table_name(),
181 self.right_table,
182 self.left_col.table_name(),
183 self.left_col.column_name(),
184 self.right_table,
185 self.right_col,
186 where_clause
187 );
188 RawQuery::new(sql)
189 }
190}
191
192// RightSemiJoin where() operates on R

Callers 15

test_simple_selectFunction · 0.45
test_where_literalFunction · 0.45
test_where_gte_lteFunction · 0.45
test_ne_comparisonFunction · 0.45
test_not_comparisonFunction · 0.45
test_not_with_andFunction · 0.45
test_filter_aliasFunction · 0.45
test_or_comparisonFunction · 0.45

Calls 5

format_exprFunction · 0.85
newFunction · 0.50
mapMethod · 0.45
pushMethod · 0.45
is_emptyMethod · 0.45

Tested by 15

test_simple_selectFunction · 0.36
test_where_literalFunction · 0.36
test_where_gte_lteFunction · 0.36
test_ne_comparisonFunction · 0.36
test_not_comparisonFunction · 0.36
test_not_with_andFunction · 0.36
test_filter_aliasFunction · 0.36
test_or_comparisonFunction · 0.36