예제 #1
0
// Returns a representation of "a!=b"
func Neq(lhs, rhs Expression) BoolExpression {
	lit, ok := rhs.(*literalExpression)
	if ok && sqltypes.Value(lit.value).IsNull() {
		return newBoolExpression(lhs, rhs, []byte(" IS NOT "))
	}
	return newBoolExpression(lhs, rhs, []byte("!="))
}
예제 #2
0
func (c literalExpression) SerializeSql(out *bytes.Buffer) error {
	sqltypes.Value(c.value).EncodeSql(out)
	return nil
}