github.com/RevenueMonster/sqlike@v1.0.6/sql/expr/type_safe.go (about)

     1  package expr
     2  
     3  import (
     4  	"reflect"
     5  
     6  	"github.com/RevenueMonster/sqlike/sqlike/primitive"
     7  )
     8  
     9  // String :
    10  func String(val string) (o primitive.TypeSafe) {
    11  	o.Type = reflect.String
    12  	o.Value = val
    13  	return
    14  }
    15  
    16  // Bool :
    17  func Bool(val bool) (o primitive.TypeSafe) {
    18  	o.Type = reflect.Bool
    19  	o.Value = val
    20  	return
    21  }
    22  
    23  // Int64 :
    24  func Int64(val int64) (o primitive.TypeSafe) {
    25  	o.Type = reflect.Int64
    26  	o.Value = val
    27  	return
    28  }
    29  
    30  // Int32 :
    31  func Int32(val int32) (o primitive.TypeSafe) {
    32  	o.Type = reflect.Int32
    33  	o.Value = val
    34  	return
    35  }
    36  
    37  // Int16 :
    38  func Int16(val int16) (o primitive.TypeSafe) {
    39  	o.Type = reflect.Int16
    40  	o.Value = val
    41  	return
    42  }
    43  
    44  // Int8 :
    45  func Int8(val int8) (o primitive.TypeSafe) {
    46  	o.Type = reflect.Int8
    47  	o.Value = val
    48  	return
    49  }
    50  
    51  // Int :
    52  func Int(val int) (o primitive.TypeSafe) {
    53  	o.Type = reflect.Int
    54  	o.Value = val
    55  	return
    56  }
    57  
    58  // Uint64 :
    59  func Uint64(val uint64) (o primitive.TypeSafe) {
    60  	o.Type = reflect.Uint64
    61  	o.Value = val
    62  	return
    63  }
    64  
    65  // Uint32 :
    66  func Uint32(val uint32) (o primitive.TypeSafe) {
    67  	o.Type = reflect.Uint32
    68  	o.Value = val
    69  	return
    70  }
    71  
    72  // Uint16 :
    73  func Uint16(val uint16) (o primitive.TypeSafe) {
    74  	o.Type = reflect.Uint16
    75  	o.Value = val
    76  	return
    77  }
    78  
    79  // Uint8 :
    80  func Uint8(val uint8) (o primitive.TypeSafe) {
    81  	o.Type = reflect.Uint8
    82  	o.Value = val
    83  	return
    84  }
    85  
    86  // Uint :
    87  func Uint(val uint) (o primitive.TypeSafe) {
    88  	o.Type = reflect.Uint
    89  	o.Value = val
    90  	return
    91  }
    92  
    93  // Float32 :
    94  func Float32(val float32) (o primitive.TypeSafe) {
    95  	o.Type = reflect.Float32
    96  	o.Value = val
    97  	return
    98  }
    99  
   100  // Float64 :
   101  func Float64(val float64) (o primitive.TypeSafe) {
   102  	o.Type = reflect.Float64
   103  	o.Value = val
   104  	return
   105  }