forked from gobuffalo/pop
-
Notifications
You must be signed in to change notification settings - Fork 1
/
query_joins.go
36 lines (29 loc) · 1.24 KB
/
query_joins.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
package pop
func (q *Query) Join(table string, on string, args ...interface{}) *Query {
q.joinClauses = append(q.joinClauses, joinClause{"JOIN", table, on, args})
return q
}
func (q *Query) LeftJoin(table string, on string, args ...interface{}) *Query {
q.joinClauses = append(q.joinClauses, joinClause{"LEFT JOIN", table, on, args})
return q
}
func (q *Query) RightJoin(table string, on string, args ...interface{}) *Query {
q.joinClauses = append(q.joinClauses, joinClause{"RIGHT JOIN", table, on, args})
return q
}
func (q *Query) LeftOuterJoin(table string, on string, args ...interface{}) *Query {
q.joinClauses = append(q.joinClauses, joinClause{"LEFT OUTER JOIN", table, on, args})
return q
}
func (q *Query) RightOuterJoin(table string, on string, args ...interface{}) *Query {
q.joinClauses = append(q.joinClauses, joinClause{"RIGHT OUTER JOIN", table, on, args})
return q
}
func (q *Query) LeftInnerJoin(table string, on string, args ...interface{}) *Query {
q.joinClauses = append(q.joinClauses, joinClause{"LEFT INNER JOIN", table, on, args})
return q
}
func (q *Query) RightInnerJoin(table string, on string, args ...interface{}) *Query {
q.joinClauses = append(q.joinClauses, joinClause{"RIGHT INNER JOIN", table, on, args})
return q
}