Documentation ¶
Index ¶
- Variables
- func ConvertsionError(convErr error, typ reflect.Type) error
- func OverflowErr(i interface{}, typ reflect.Type) error
- type Cell
- func (c Cell) AsInterface() (interface{}, error)
- func (c Cell) Bool() (bool, error)
- func (c Cell) Float32() (float32, error)
- func (c Cell) Float64() (float64, error)
- func (c Cell) Int32() (int32, error)
- func (c Cell) Int64() (int64, error)
- func (c Cell) IsNull() bool
- func (c Cell) IsValid() bool
- func (c Cell) Kind() reflect.Kind
- func (c Cell) NullBool() (sql.NullBool, error)
- func (c Cell) NullFloat64() (sql.NullFloat64, error)
- func (c Cell) NullInt32() (sql.NullInt32, error)
- func (c Cell) NullInt64() (sql.NullInt64, error)
- func (c Cell) NullString() (sql.NullString, error)
- func (c Cell) NullTime() (sql.NullTime, error)
- func (c *Cell) Scan(src interface{}) error
- func (c *Cell) SetBool(d bool)
- func (c *Cell) SetFloat64(d float64)
- func (c *Cell) SetInt64(d int64)
- func (c *Cell) SetNull()
- func (c *Cell) SetString(d string)
- func (c *Cell) SetTime(d time.Time)
- func (c Cell) String() (string, error)
- func (c Cell) Time() (time.Time, error)
- func (c Cell) Timestamp() (timestamp.Timestamp, error)
- func (c Cell) Uid() string
- func (c Cell) Uint32() (uint32, error)
- func (c Cell) Uint64() (uint64, error)
- type Value
Constants ¶
This section is empty.
Variables ¶
View Source
var BasicKinds = map[reflect.Kind]Value{ reflect.Bool: Bool, reflect.Int: Int, reflect.Int8: Int8, reflect.Int16: Int16, reflect.Int32: Int32, reflect.Int64: Int64, reflect.Uint: Uint, reflect.Uint8: Uint8, reflect.Uint16: Uint16, reflect.Uint32: Uint32, reflect.Uint64: Uint64, reflect.Float32: Float32, reflect.Float64: Float64, reflect.String: String, }
View Source
var BasicTypes = map[reflect.Type]Value{ reflect.TypeOf(time.Time{}): Time, reflect.TypeOf(timestamp.Timestamp{}): Timestamp, reflect.TypeOf(sql.NullBool{}): NullBool, reflect.TypeOf(sql.NullFloat64{}): NullFloat64, reflect.TypeOf(sql.NullInt32{}): NullInt32, reflect.TypeOf(sql.NullInt64{}): NullInt64, reflect.TypeOf(sql.NullString{}): NullString, reflect.TypeOf(sql.NullTime{}): NullTime, }
View Source
var NullableTypes = map[reflect.Type]Value{ reflect.TypeOf(sql.NullBool{}): NullBool, reflect.TypeOf(sql.NullFloat64{}): NullFloat64, reflect.TypeOf(sql.NullInt32{}): NullInt32, reflect.TypeOf(sql.NullInt64{}): NullInt64, reflect.TypeOf(sql.NullString{}): NullString, reflect.TypeOf(sql.NullTime{}): NullTime, }
Functions ¶
func OverflowErr ¶
Types ¶
type Cell ¶
type Cell struct {
// contains filtered or unexported fields
}
func (Cell) AsInterface ¶
func (Cell) NullFloat64 ¶
func (c Cell) NullFloat64() (sql.NullFloat64, error)
func (Cell) NullString ¶
func (c Cell) NullString() (sql.NullString, error)
func (*Cell) SetFloat64 ¶
type Value ¶
type Value int
Value represents go data types which carta supports for loading as well as what data types arrive from the sql driver
const ( Invalid Value = iota Time Timestamp NullBool NullFloat64 NullInt32 NullInt64 NullString NullTime Float64 Float32 Int Int8 Int16 Int32 Uint Uint8 Uint16 Uint32 Int64 Uint64 Bool String // note, []uint8get converted to string, this is because mysql returns []uint8 for varchar while pg returns string )
NOTE, carta does NOT support loading []uint8, any data that arrives from sql database as []uint8 is converted to bytes and expected field type is a string or *string
Click to show internal directories.
Click to hide internal directories.