Add support for INTERVAL operator.
This commit is contained in:
parent
4f9323ddca
commit
dd9b815dbb
4 changed files with 57 additions and 27 deletions
|
|
@ -48,3 +48,25 @@ func (t *timeInterfaceImpl) LtEq(expression TimeExpression) BoolExpression {
|
|||
func (t *timeInterfaceImpl) LtEqL(literal string) BoolExpression {
|
||||
return LtEq(t.parent, Literal(literal))
|
||||
}
|
||||
|
||||
//---------------------------------------------------//
|
||||
type prefixTimeExpression struct {
|
||||
expressionInterfaceImpl
|
||||
timeInterfaceImpl
|
||||
|
||||
prefixExpression
|
||||
}
|
||||
|
||||
func newPrefixTimeExpression(expression Expression, operator string) TimeExpression {
|
||||
timeExpr := prefixTimeExpression{}
|
||||
timeExpr.prefixExpression = newPrefixExpression(expression, operator)
|
||||
|
||||
timeExpr.expressionInterfaceImpl.parent = &timeExpr
|
||||
timeExpr.timeInterfaceImpl.parent = &timeExpr
|
||||
|
||||
return &timeExpr
|
||||
}
|
||||
|
||||
func INTERVAL(interval string) Expression {
|
||||
return newPrefixTimeExpression(Literal(interval), "INTERVAL")
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue