...
1 package exp
2
3 type cast struct {
4 casted Expression
5 t LiteralExpression
6 }
7
8
9
10 func NewCastExpression(e Expression, t string) CastExpression {
11 return cast{casted: e, t: NewLiteralExpression(t)}
12 }
13
14 func (c cast) Casted() Expression {
15 return c.casted
16 }
17
18 func (c cast) Type() LiteralExpression {
19 return c.t
20 }
21
22 func (c cast) Clone() Expression {
23 return cast{casted: c.casted.Clone(), t: c.t}
24 }
25
26 func (c cast) Expression() Expression { return c }
27 func (c cast) As(val interface{}) AliasedExpression { return NewAliasExpression(c, val) }
28 func (c cast) Eq(val interface{}) BooleanExpression { return eq(c, val) }
29 func (c cast) Neq(val interface{}) BooleanExpression { return neq(c, val) }
30 func (c cast) Gt(val interface{}) BooleanExpression { return gt(c, val) }
31 func (c cast) Gte(val interface{}) BooleanExpression { return gte(c, val) }
32 func (c cast) Lt(val interface{}) BooleanExpression { return lt(c, val) }
33 func (c cast) Lte(val interface{}) BooleanExpression { return lte(c, val) }
34 func (c cast) Asc() OrderedExpression { return asc(c) }
35 func (c cast) Desc() OrderedExpression { return desc(c) }
36 func (c cast) Like(i interface{}) BooleanExpression { return like(c, i) }
37 func (c cast) NotLike(i interface{}) BooleanExpression { return notLike(c, i) }
38 func (c cast) ILike(i interface{}) BooleanExpression { return iLike(c, i) }
39 func (c cast) NotILike(i interface{}) BooleanExpression { return notILike(c, i) }
40 func (c cast) RegexpLike(val interface{}) BooleanExpression { return regexpLike(c, val) }
41 func (c cast) RegexpNotLike(val interface{}) BooleanExpression { return regexpNotLike(c, val) }
42 func (c cast) RegexpILike(val interface{}) BooleanExpression { return regexpILike(c, val) }
43 func (c cast) RegexpNotILike(val interface{}) BooleanExpression { return regexpNotILike(c, val) }
44 func (c cast) In(i ...interface{}) BooleanExpression { return in(c, i...) }
45 func (c cast) NotIn(i ...interface{}) BooleanExpression { return notIn(c, i...) }
46 func (c cast) Is(i interface{}) BooleanExpression { return is(c, i) }
47 func (c cast) IsNot(i interface{}) BooleanExpression { return isNot(c, i) }
48 func (c cast) IsNull() BooleanExpression { return is(c, nil) }
49 func (c cast) IsNotNull() BooleanExpression { return isNot(c, nil) }
50 func (c cast) IsTrue() BooleanExpression { return is(c, true) }
51 func (c cast) IsNotTrue() BooleanExpression { return isNot(c, true) }
52 func (c cast) IsFalse() BooleanExpression { return is(c, false) }
53 func (c cast) IsNotFalse() BooleanExpression { return isNot(c, false) }
54 func (c cast) Distinct() SQLFunctionExpression { return NewSQLFunctionExpression("DISTINCT", c) }
55 func (c cast) Between(val RangeVal) RangeExpression { return between(c, val) }
56 func (c cast) NotBetween(val RangeVal) RangeExpression { return notBetween(c, val) }
57
View as plain text