2019-04-03 11:03:07 +02:00
|
|
|
package sqlbuilder
|
|
|
|
|
|
|
|
|
|
type StringExpression interface {
|
|
|
|
|
Expression
|
|
|
|
|
|
|
|
|
|
Eq(expression StringExpression) BoolExpression
|
|
|
|
|
EqL(value string) BoolExpression
|
|
|
|
|
NotEq(expression StringExpression) BoolExpression
|
2019-04-04 13:07:21 +02:00
|
|
|
NotEqL(value string) BoolExpression
|
2019-04-03 11:03:07 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type stringInterfaceImpl struct {
|
|
|
|
|
parent StringExpression
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (b *stringInterfaceImpl) Eq(expression StringExpression) BoolExpression {
|
2019-05-05 18:03:30 +02:00
|
|
|
return newBinaryBoolExpression(b.parent, expression, " = ")
|
2019-04-03 11:03:07 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (b *stringInterfaceImpl) EqL(value string) BoolExpression {
|
2019-05-05 18:03:30 +02:00
|
|
|
return newBinaryBoolExpression(b.parent, Literal(value), " = ")
|
2019-04-03 11:03:07 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (b *stringInterfaceImpl) NotEq(expression StringExpression) BoolExpression {
|
2019-05-05 18:03:30 +02:00
|
|
|
return newBinaryBoolExpression(b.parent, expression, " != ")
|
2019-04-03 11:03:07 +02:00
|
|
|
}
|
2019-04-04 13:07:21 +02:00
|
|
|
|
|
|
|
|
func (b *stringInterfaceImpl) NotEqL(value string) BoolExpression {
|
2019-05-05 18:03:30 +02:00
|
|
|
return newBinaryBoolExpression(b.parent, Literal(value), " != ")
|
2019-04-04 13:07:21 +02:00
|
|
|
}
|