Source File
joins.go
Belonging Package
gorm.io/gorm/clause
package clause
type JoinType string
const (
CrossJoin JoinType = "CROSS"
InnerJoin JoinType = "INNER"
LeftJoin JoinType = "LEFT"
RightJoin JoinType = "RIGHT"
)
// Join clause for from
type Join struct {
Type JoinType
Table Table
ON Where
Using []string
Expression Expression
}
func ( Join) ( Builder) {
if .Expression != nil {
.Expression.Build()
} else {
if .Type != "" {
.WriteString(string(.Type))
.WriteByte(' ')
}
.WriteString("JOIN ")
.WriteQuoted(.Table)
if len(.ON.Exprs) > 0 {
.WriteString(" ON ")
.ON.Build()
} else if len(.Using) > 0 {
.WriteString(" USING (")
for , := range .Using {
if > 0 {
.WriteByte(',')
}
.WriteQuoted()
}
.WriteByte(')')
}
}
}
![]() |
The pages are generated with Golds v0.6.7. (GOOS=linux GOARCH=amd64) Golds is a Go 101 project developed by Tapir Liu. PR and bug reports are welcome and can be submitted to the issue list. Please follow @Go100and1 (reachable from the left QR code) to get the latest news of Golds. |