代码拉取完成,页面将自动刷新
package builder
import (
"context"
)
type CombinationAddition struct {
}
func (CombinationAddition) AdditionType() AdditionType {
return AdditionCombination
}
func Union() *combination {
return &combination{
operator: "UNION",
}
}
func Intersect() *combination {
return &combination{
operator: "INTERSECT",
}
}
func Expect() *combination {
return &combination{
operator: "EXCEPT",
}
}
var _ Addition = (*combination)(nil)
type combination struct {
CombinationAddition
operator string // UNION | INTERSECT | EXCEPT
method string // ALL | DISTINCT
stmtSelect SelectStatement
}
func (c *combination) IsNil() bool {
return c == nil || IsNilExpr(c.stmtSelect)
}
func (c combination) All(stmtSelect SelectStatement) *combination {
c.method = "ALL"
c.stmtSelect = stmtSelect
return &c
}
func (c combination) Distinct(stmtSelect SelectStatement) *combination {
c.method = "DISTINCT"
c.stmtSelect = stmtSelect
return &c
}
func (c *combination) Ex(ctx context.Context) *Ex {
e := Expr("")
e.Grow(1)
e.WriteQuery(c.operator)
e.WriteQueryByte(' ')
if c.method != "" {
e.WriteQuery(c.method)
e.WriteQueryByte(' ')
}
e.WriteExpr(c.stmtSelect)
return e.Ex(ctx)
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。