Skip to content

Commit

Permalink
Revert "feat: add some bitwise operations". There is no Test case for
Browse files Browse the repository at this point in the history
this commit, Maybe create PR later

This reverts commit 13b7aba.
  • Loading branch information
VarusHsu committed Feb 18, 2024
1 parent ed3a4af commit 238fe71
Showing 1 changed file with 0 additions and 22 deletions.
22 changes: 0 additions & 22 deletions expression.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,11 +76,6 @@ type NumberExpression interface {
Avg() NumberExpression
Min() UnknownExpression
Max() UnknownExpression

BitWiseAnd(other interface{}) NumberExpression
BitWiseOr(other interface{}) NumberExpression
BitWiseXor(other interface{}) NumberExpression
BitWiseNot() NumberExpression
}

// StringExpression is the interface of an SQL expression with string value.
Expand Down Expand Up @@ -539,23 +534,6 @@ func (e expression) Contains(substring string) BooleanExpression {
return function("LOCATE", substring, e).GreaterThan(0)
}

func (e expression) BitWiseAnd(other interface{}) NumberExpression {
return e.binaryOperation("&", other, 9, false)
}

func (e expression) BitWiseOr(other interface{}) NumberExpression {
return e.binaryOperation("|", other, 10, false)
}

func (e expression) BitWiseXor(other interface{}) NumberExpression {
return e.binaryOperation("^", other, 5, false)
}

func (e expression) BitWiseNot() NumberExpression {
return e.prefixSuffixExpression("~", "", 4, false)

}

func (e expression) binaryOperation(operator string, value interface{}, priority priority, isBool bool) expression {
return expression{builder: func(scope scope) (string, error) {
leftSql, err := e.GetSQL(scope)
Expand Down

0 comments on commit 238fe71

Please sign in to comment.