Documentation ¶
Index ¶
- Constants
- Variables
- func CompareDecimal128Decimal128(a, b Decimal128, aScale, bScale int32) (result int64)
- func CompareDecimal128Decimal128Aligned(a, b Decimal128) (result int64)
- func CompareDecimal64Decimal64(a, b Decimal64, aScale, bScale int32) (result int64)
- func CompareDecimal64Decimal64Aligned(a, b Decimal64) (result int64)
- func Decimal128IsNegative(a Decimal128) (result bool)
- func Decimal128IsNotZero(a Decimal128) (result bool)
- func Decimal128IsZero(a Decimal128) (result bool)
- func ModDecimal128By10Abs(a Decimal128) (result int64)
- type Bytes
- type Date
- func (d Date) Calendar(full bool) (year int32, month, day uint8, yday uint16)
- func (d Date) DayOfWeek() Weekday
- func (d Date) DayOfYear() uint16
- func (d Date) Month() uint8
- func (d Date) String() string
- func (d Date) ToTime() Datetime
- func (d Date) WeekOfYear() (year int32, week uint8)
- func (d Date) Year() uint16
- type Datetime
- type Decimal128
- func AddDecimal128ByInt64(a Decimal128, value int64) (result Decimal128)
- func Decimal128Add(a, b Decimal128, aScale, bScale int32) (result Decimal128)
- func Decimal128AddAligned(a, b Decimal128) (result Decimal128)
- func Decimal128Decimal128Div(a, b Decimal128, aScale, bScale int32) (result Decimal128)
- func Decimal128Decimal128Mul(a Decimal128, b Decimal128) (result Decimal128)
- func Decimal128Sub(a, b Decimal128, aScale, bScale int32) (result Decimal128)
- func Decimal128SubAligned(a, b Decimal128) (result Decimal128)
- func Decimal64Decimal64Div(a, b Decimal64, aScale, bScale int32) (result Decimal128)
- func Decimal64Decimal64Mul(a Decimal64, b Decimal64) (result Decimal128)
- func Decimal64ToDecimal128(a Decimal64) (result Decimal128)
- func DivideDecimal128By10(a Decimal128) (result Decimal128)
- func InitDecimal128(value int64) (result Decimal128)
- func NegDecimal128(a Decimal128) (result Decimal128)
- func ParseStringToDecimal128(s string, precision, scale int32) (result Decimal128, err error)
- func ParseStringToDecimal128WithoutTable(s string) (result Decimal128, scale int32, err error)
- func ScaleDecimal128By10(a Decimal128) (result Decimal128)
- type Decimal64
- func Decimal64Add(a, b Decimal64, aScale, bScale int32) (result Decimal64)
- func Decimal64AddAligned(a, b Decimal64) (result Decimal64)
- func Decimal64Sub(a, b Decimal64, aScale, bScale int32) (result Decimal64)
- func Decimal64SubAligned(a, b Decimal64) (result Decimal64)
- func ParseStringToDecimal64(s string, precision, scale int32) (result Decimal64, err error)
- func ScaleDecimal64(a Decimal64, b int64) (result Decimal64)
- func ScaleDecimal64By10(a Decimal64) (result Decimal64)
- type T
- type Type
- type Weekday
Constants ¶
View Source
const ( MaxDateYear = 9999 MinDateYear = 0 MaxMonthInYear = 12 MinMonthInYear = 1 )
Variables ¶
View Source
var Types map[string]T = map[string]T{ "tinyint": T_int8, "smallint": T_int16, "int": T_int32, "integer": T_int32, "bigint": T_int64, "tinyint unsigned": T_uint8, "smallint unsigned": T_uint16, "int unsigned": T_uint32, "integer unsigned": T_uint32, "bigint unsigned": T_uint64, "decimal64": T_decimal64, "decimal128": T_decimal128, "float": T_float32, "double": T_float64, "date": T_date, "datetime": T_datetime, "char": T_char, "varchar": T_varchar, "json": T_json, }
Functions ¶
func CompareDecimal128Decimal128 ¶
func CompareDecimal128Decimal128(a, b Decimal128, aScale, bScale int32) (result int64)
func CompareDecimal128Decimal128Aligned ¶
func CompareDecimal128Decimal128Aligned(a, b Decimal128) (result int64)
func Decimal128IsNegative ¶
func Decimal128IsNegative(a Decimal128) (result bool)
func Decimal128IsNotZero ¶
func Decimal128IsNotZero(a Decimal128) (result bool)
func Decimal128IsZero ¶
func Decimal128IsZero(a Decimal128) (result bool)
func ModDecimal128By10Abs ¶
func ModDecimal128By10Abs(a Decimal128) (result int64)
Types ¶
type Date ¶
type Date int32
func FromCalendar ¶
func (Date) WeekOfYear ¶
type Datetime ¶
type Datetime int64
func ParseDatetime ¶
ParseDatetime will parse a string to be a Datetime Support Format: 1. all the Date value 2. yyyy-mm-dd hh:mm:ss(.msec) 3. yyyymmddhhmmss(.msec)
type Decimal128 ¶
type Decimal128 struct {
// contains filtered or unexported fields
}
func AddDecimal128ByInt64 ¶
func AddDecimal128ByInt64(a Decimal128, value int64) (result Decimal128)
func Decimal128Add ¶
func Decimal128Add(a, b Decimal128, aScale, bScale int32) (result Decimal128)
func Decimal128AddAligned ¶
func Decimal128AddAligned(a, b Decimal128) (result Decimal128)
func Decimal128Decimal128Div ¶
func Decimal128Decimal128Div(a, b Decimal128, aScale, bScale int32) (result Decimal128)
func Decimal128Decimal128Mul ¶
func Decimal128Decimal128Mul(a Decimal128, b Decimal128) (result Decimal128)
func Decimal128Sub ¶
func Decimal128Sub(a, b Decimal128, aScale, bScale int32) (result Decimal128)
func Decimal128SubAligned ¶
func Decimal128SubAligned(a, b Decimal128) (result Decimal128)
func Decimal64Decimal64Div ¶
func Decimal64Decimal64Div(a, b Decimal64, aScale, bScale int32) (result Decimal128)
func Decimal64Decimal64Mul ¶
func Decimal64Decimal64Mul(a Decimal64, b Decimal64) (result Decimal128)
func Decimal64ToDecimal128 ¶
func Decimal64ToDecimal128(a Decimal64) (result Decimal128)
func DivideDecimal128By10 ¶
func DivideDecimal128By10(a Decimal128) (result Decimal128)
func InitDecimal128 ¶
func InitDecimal128(value int64) (result Decimal128)
func NegDecimal128 ¶
func NegDecimal128(a Decimal128) (result Decimal128)
func ParseStringToDecimal128 ¶
func ParseStringToDecimal128(s string, precision, scale int32) (result Decimal128, err error)
func ParseStringToDecimal128WithoutTable ¶
func ParseStringToDecimal128WithoutTable(s string) (result Decimal128, scale int32, err error)
func ScaleDecimal128By10 ¶
func ScaleDecimal128By10(a Decimal128) (result Decimal128)
func (Decimal128) Decimal128ToString ¶
func (a Decimal128) Decimal128ToString(scale int32) []byte
type Decimal64 ¶
type Decimal64 int64
func Decimal64Add ¶
func Decimal64AddAligned ¶
func Decimal64Sub ¶
func Decimal64SubAligned ¶
func ParseStringToDecimal64 ¶
todo: use strconv to simplify this code
func ScaleDecimal64 ¶
func ScaleDecimal64By10 ¶
func (Decimal64) Decimal64ToString ¶
type T ¶
type T uint8
const ( // any family T_any T = T(plan.Type_ANY) // numeric/integer family T_int8 T = T(plan.Type_INT8) T_int16 T = T(plan.Type_INT16) T_int32 T = T(plan.Type_INT32) T_int64 T = T(plan.Type_INT64) T_uint8 T = T(plan.Type_UINT8) T_uint16 T = T(plan.Type_UINT16) T_uint32 T = T(plan.Type_UINT32) T_uint64 T = T(plan.Type_UINT64) // numeric/float family - unsigned attribute is deprecated T_float32 T = T(plan.Type_FLOAT32) T_float64 T = T(plan.Type_FLOAT64) // date family T_date T = T(plan.Type_DATE) T_datetime T = T(plan.Type_DATETIME) // string family T_char T = T(plan.Type_CHAR) T_varchar T = T(plan.Type_VARCHAR) // json family T_json T = T(plan.Type_JSON) // numeric/decimal family - unsigned attribute is deprecated T_decimal64 = T(plan.Type_DECIMAL64) T_decimal128 = T(plan.Type_DECIMAL128) // system family T_sel T = T(plan.Type_SEL) //selection T_tuple T = T(plan.Type_TUPLE) // immutable, size = 24 )
func (T) FixedLength ¶
type Type ¶
type Type struct { Oid T `json:"oid,string"` Size int32 `json:"size,string"` // e.g. int8.Size = 1, int16.Size = 2, char.Size = 24(SliceHeader size) // Width means max Display width for float and double, char and varchar // todo: need to add new attribute DisplayWidth ? Width int32 `json:"width,string"` Scale int32 `json:"Scale,string"` Precision int32 `json:"Precision,string"` }
Click to show internal directories.
Click to hide internal directories.