github.com/RevenueMonster/sqlike@v1.0.6/sql/expr/math.go (about) 1 package expr 2 3 import "github.com/RevenueMonster/sqlike/sqlike/primitive" 4 5 // Increment : 6 func Increment(field string, inc uint) primitive.Math { 7 return primitive.Math{ 8 Field: field, 9 Mode: primitive.Add, 10 Value: int(inc), 11 } 12 } 13 14 // Decrement : 15 func Decrement(field string, inc uint) primitive.Math { 16 return primitive.Math{ 17 Field: field, 18 Mode: primitive.Deduct, 19 Value: int(inc), 20 } 21 } 22 23 // Multiply : 24 func Multiply(fields ...interface{}) (grp primitive.Group) { 25 for i, f := range fields { 26 if i > 0 { 27 grp.Values = append(grp.Values, Raw("*")) 28 } 29 grp.Values = append(grp.Values, wrapColumn(f)) 30 } 31 return 32 }