Generic dialect support. (MySQL and Postgres)

This commit is contained in:
go-jet 2019-07-28 14:57:02 +02:00
parent 043a0dc4c0
commit 5dda5e1e11
27 changed files with 440 additions and 92 deletions

View file

@ -108,6 +108,24 @@ func (c *caseOperatorImpl) ELSE(els Expression) CaseOperator {
return c
}
func (c *caseOperatorImpl) accept(visitor visitor) {
visitor.visit(c)
c.expression.accept(visitor)
for _, when := range c.when {
when.accept(visitor)
}
for _, then := range c.then {
then.accept(visitor)
}
if c.els != nil {
c.els.accept(visitor)
}
}
func (c *caseOperatorImpl) serialize(statement statementType, out *sqlBuilder, options ...serializeOption) error {
if c == nil {
return errors.New("jet: Case Expression is nil. ")