1use super::builder::QueryBuilder;
4use super::types::*;
5
6impl<M> QueryBuilder<M> {
7 pub fn join(mut self, table: &str, left_col: &str, right_col: &str) -> Self {
9 self.joins.push(JoinClause {
10 join_type: JoinType::Inner,
11 table: table.to_string(),
12 on_conditions: vec![(left_col.to_string(), right_col.to_string())],
13 });
14 self
15 }
16
17 pub fn left_join(mut self, table: &str, left_col: &str, right_col: &str) -> Self {
19 self.joins.push(JoinClause {
20 join_type: JoinType::Left,
21 table: table.to_string(),
22 on_conditions: vec![(left_col.to_string(), right_col.to_string())],
23 });
24 self
25 }
26
27 pub fn right_join(mut self, table: &str, left_col: &str, right_col: &str) -> Self {
29 self.joins.push(JoinClause {
30 join_type: JoinType::Right,
31 table: table.to_string(),
32 on_conditions: vec![(left_col.to_string(), right_col.to_string())],
33 });
34 self
35 }
36}