Пример #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(d Dialect, out *bytes.Buffer) error {
	sqltypes.Value(c.value).EncodeSql(out)
	return nil
}