2020-08-06 20:58:47 +03:00
|
|
|
package sqlz
|
|
|
|
|
|
|
|
import (
|
|
|
|
"database/sql"
|
|
|
|
"reflect"
|
|
|
|
"time"
|
2023-11-22 00:49:52 +03:00
|
|
|
|
|
|
|
"github.com/shopspring/decimal"
|
2020-08-06 20:58:47 +03:00
|
|
|
)
|
|
|
|
|
|
|
|
// Cached results from reflect.TypeOf for commonly used types.
|
|
|
|
var (
|
|
|
|
RTypeInt = reflect.TypeOf(0)
|
|
|
|
RTypeInt8 = reflect.TypeOf(int8(0))
|
|
|
|
RTypeInt16 = reflect.TypeOf(int16(0))
|
|
|
|
RTypeInt32 = reflect.TypeOf(int32(0))
|
|
|
|
RTypeInt64 = reflect.TypeOf(int64(0))
|
|
|
|
RTypeNullInt64 = reflect.TypeOf(sql.NullInt64{})
|
2023-11-22 00:49:52 +03:00
|
|
|
RTypeDecimal = reflect.TypeOf(decimal.Decimal{})
|
|
|
|
RTypeNullDecimal = reflect.TypeOf(decimal.NullDecimal{})
|
2020-08-06 20:58:47 +03:00
|
|
|
RTypeFloat32 = reflect.TypeOf(float32(0))
|
|
|
|
RTypeFloat64 = reflect.TypeOf(float64(0))
|
|
|
|
RTypeNullFloat64 = reflect.TypeOf(sql.NullFloat64{})
|
|
|
|
RTypeBool = reflect.TypeOf(true)
|
|
|
|
RTypeNullBool = reflect.TypeOf(sql.NullBool{})
|
|
|
|
RTypeString = reflect.TypeOf("")
|
|
|
|
RTypeNullString = reflect.TypeOf(sql.NullString{})
|
|
|
|
RTypeTime = reflect.TypeOf(time.Time{})
|
|
|
|
RTypeNullTime = reflect.TypeOf(sql.NullTime{})
|
|
|
|
RTypeBytes = reflect.TypeOf([]byte{})
|
|
|
|
RTypeNil = reflect.TypeOf(nil)
|
2022-12-24 07:05:26 +03:00
|
|
|
RTypeAny = reflect.TypeOf((any)(nil))
|
2020-08-06 20:58:47 +03:00
|
|
|
)
|