2019-08-03 14:10:47 +02:00
|
|
|
package mysql
|
|
|
|
|
|
2020-06-27 18:48:19 +02:00
|
|
|
import "github.com/go-jet/jet/v2/internal/jet"
|
2019-08-03 14:10:47 +02:00
|
|
|
|
2019-08-17 10:43:16 +02:00
|
|
|
// Expression is common interface for all expressions.
|
2021-02-22 13:58:28 -05:00
|
|
|
// Can be Bool, Int, Float, String, Date, Time or Timestamp expressions.
|
2019-09-26 11:44:46 +02:00
|
|
|
type Expression = jet.Expression
|
2019-08-03 14:10:47 +02:00
|
|
|
|
2019-08-17 10:43:16 +02:00
|
|
|
// BoolExpression interface
|
2019-09-26 11:44:46 +02:00
|
|
|
type BoolExpression = jet.BoolExpression
|
2019-08-03 14:10:47 +02:00
|
|
|
|
2019-08-17 10:43:16 +02:00
|
|
|
// StringExpression interface
|
2019-09-26 11:44:46 +02:00
|
|
|
type StringExpression = jet.StringExpression
|
2019-08-03 14:10:47 +02:00
|
|
|
|
2019-08-17 10:43:16 +02:00
|
|
|
// IntegerExpression interface
|
2019-09-26 11:44:46 +02:00
|
|
|
type IntegerExpression = jet.IntegerExpression
|
2019-08-03 14:10:47 +02:00
|
|
|
|
2019-08-17 10:43:16 +02:00
|
|
|
// FloatExpression interface
|
2019-09-26 11:44:46 +02:00
|
|
|
type FloatExpression = jet.FloatExpression
|
2019-08-03 14:10:47 +02:00
|
|
|
|
2019-08-17 10:43:16 +02:00
|
|
|
// TimeExpression interface
|
2019-09-26 11:44:46 +02:00
|
|
|
type TimeExpression = jet.TimeExpression
|
2019-08-06 10:29:04 +02:00
|
|
|
|
2019-08-17 10:43:16 +02:00
|
|
|
// DateExpression interface
|
2019-09-26 11:44:46 +02:00
|
|
|
type DateExpression = jet.DateExpression
|
2019-08-03 14:10:47 +02:00
|
|
|
|
2019-08-17 10:43:16 +02:00
|
|
|
// DateTimeExpression interface
|
2019-09-26 11:44:46 +02:00
|
|
|
type DateTimeExpression = jet.TimestampExpression
|
2019-08-03 14:10:47 +02:00
|
|
|
|
2019-08-17 10:43:16 +02:00
|
|
|
// TimestampExpression interface
|
2019-09-26 11:44:46 +02:00
|
|
|
type TimestampExpression = jet.TimestampExpression
|
2019-08-03 14:10:47 +02:00
|
|
|
|
2019-08-17 10:43:16 +02:00
|
|
|
// BoolExp is bool expression wrapper around arbitrary expression.
|
|
|
|
|
// Allows go compiler to see any expression as bool expression.
|
|
|
|
|
// Does not add sql cast to generated sql builder output.
|
2019-08-06 10:29:04 +02:00
|
|
|
var BoolExp = jet.BoolExp
|
2019-08-17 10:43:16 +02:00
|
|
|
|
|
|
|
|
// StringExp is string expression wrapper around arbitrary expression.
|
|
|
|
|
// Allows go compiler to see any expression as string expression.
|
|
|
|
|
// Does not add sql cast to generated sql builder output.
|
2019-08-06 10:29:04 +02:00
|
|
|
var StringExp = jet.StringExp
|
2019-08-17 10:43:16 +02:00
|
|
|
|
|
|
|
|
// IntExp is int expression wrapper around arbitrary expression.
|
|
|
|
|
// Allows go compiler to see any expression as int expression.
|
|
|
|
|
// Does not add sql cast to generated sql builder output.
|
2019-08-06 10:29:04 +02:00
|
|
|
var IntExp = jet.IntExp
|
2019-08-17 10:43:16 +02:00
|
|
|
|
|
|
|
|
// FloatExp is date expression wrapper around arbitrary expression.
|
|
|
|
|
// Allows go compiler to see any expression as float expression.
|
|
|
|
|
// Does not add sql cast to generated sql builder output.
|
2019-08-06 10:29:04 +02:00
|
|
|
var FloatExp = jet.FloatExp
|
2019-08-17 10:43:16 +02:00
|
|
|
|
|
|
|
|
// TimeExp is time expression wrapper around arbitrary expression.
|
|
|
|
|
// Allows go compiler to see any expression as time expression.
|
|
|
|
|
// Does not add sql cast to generated sql builder output.
|
2019-08-06 10:29:04 +02:00
|
|
|
var TimeExp = jet.TimeExp
|
2019-08-17 10:43:16 +02:00
|
|
|
|
|
|
|
|
// DateExp is date expression wrapper around arbitrary expression.
|
|
|
|
|
// Allows go compiler to see any expression as date expression.
|
|
|
|
|
// Does not add sql cast to generated sql builder output.
|
2019-08-06 10:29:04 +02:00
|
|
|
var DateExp = jet.DateExp
|
2019-08-17 10:43:16 +02:00
|
|
|
|
|
|
|
|
// DateTimeExp is timestamp expression wrapper around arbitrary expression.
|
|
|
|
|
// Allows go compiler to see any expression as timestamp expression.
|
|
|
|
|
// Does not add sql cast to generated sql builder output.
|
2019-08-06 10:29:04 +02:00
|
|
|
var DateTimeExp = jet.TimestampExp
|
2019-08-17 10:43:16 +02:00
|
|
|
|
|
|
|
|
// TimestampExp is timestamp expression wrapper around arbitrary expression.
|
|
|
|
|
// Allows go compiler to see any expression as timestamp expression.
|
|
|
|
|
// Does not add sql cast to generated sql builder output.
|
2019-08-06 10:29:04 +02:00
|
|
|
var TimestampExp = jet.TimestampExp
|
|
|
|
|
|
2021-05-14 12:15:35 +02:00
|
|
|
// RawArgs is type used to pass optional arguments to Raw method
|
|
|
|
|
type RawArgs = map[string]interface{}
|
|
|
|
|
|
|
|
|
|
var (
|
|
|
|
|
// Raw can be used for any unsupported functions, operators or expressions.
|
|
|
|
|
// For example: Raw("current_database()")
|
|
|
|
|
Raw = jet.Raw
|
|
|
|
|
|
|
|
|
|
// Raw helper methods for each of the mysql type
|
|
|
|
|
RawInt = jet.RawInt
|
|
|
|
|
RawFloat = jet.RawFloat
|
|
|
|
|
RawString = jet.RawString
|
|
|
|
|
RawTime = jet.RawTime
|
|
|
|
|
RawTimestamp = jet.RawTimestamp
|
|
|
|
|
RawDate = jet.RawDate
|
|
|
|
|
)
|
2019-08-16 11:19:06 +02:00
|
|
|
|
2020-09-29 15:29:35 -07:00
|
|
|
// Func can be used to call an custom or as of yet unsupported function in the database.
|
|
|
|
|
var Func = jet.Func
|
|
|
|
|
|
2019-08-17 10:43:16 +02:00
|
|
|
// NewEnumValue creates new named enum value
|
2019-08-16 11:19:06 +02:00
|
|
|
var NewEnumValue = jet.NewEnumValue
|