sqlorm_core/qb/additions/
joins.rs1use crate::{QB, TableInfo};
2
3#[derive(Clone, Debug)]
4pub enum JoinType {
6 Inner,
7 Left,
8}
9
10#[derive(Clone, Debug)]
11pub struct JoinSpec {
13 pub join_type: JoinType,
15 pub relation_name: &'static str,
17 pub foreign_table: TableInfo,
19 pub on: (&'static str, &'static str),
21}
22
23impl<T> QB<T> {
24 pub fn join_eager(mut self, spec: JoinSpec) -> Self {
25 self.eager.push(spec);
26 self
27 }
28
29 pub fn join_batch(mut self, spec: JoinSpec) -> Self {
30 self.batch.push(spec);
31 self
32 }
33}