Documentation ¶
Index ¶
- Constants
- Variables
- func AppendBoolToByteArray(b bool, arr []byte) []byte
- func BitAnd(result, v1, v2 []byte)
- func BitOr(result, v1, v2 []byte)
- func BitXor(result, v1, v2 []byte)
- func BoolToIntString(b bool) string
- func CharsetType(oid T) uint8
- func CompareBlockidBlockidAligned(a, b Blockid) int64
- func CompareDecimal128(x Decimal128, y Decimal128) int64
- func CompareDecimal128WithScale(x, y Decimal128, scale1, scale2 int32) int64
- func CompareDecimal256(x Decimal256, y Decimal256) int64
- func CompareDecimal64(x Decimal64, y Decimal64) int64
- func CompareDecimal64WithScale(x, y Decimal64, scale1, scale2 int32) int64
- func CompareRowidRowidAligned(a, b Rowid) int64
- func CompareTSTSAligned(a, b TS) int64
- func CompareUuid(left Uuid, right Uuid) int64
- func Decimal128ToFloat64(x Decimal128, scale int32) float64
- func Decimal64ToFloat64(x Decimal64, scale int32) float64
- func Decode(data []byte, v encoding.BinaryUnmarshaler) error
- func DecodeBool(v []byte) bool
- func DecodeFixed[T FixedSizeT](v []byte) T
- func DecodeFloat32(v []byte) float32
- func DecodeFloat64(v []byte) float64
- func DecodeInt16(v []byte) int16
- func DecodeInt32(v []byte) int32
- func DecodeInt64(v []byte) int64
- func DecodeInt8(v []byte) int8
- func DecodeJson(buf []byte) bytejson.ByteJson
- func DecodeSlice[T any](v []byte) []T
- func DecodeStringSlice(data []byte) []string
- func DecodeUint16(v []byte) uint16
- func DecodeUint32(v []byte) uint32
- func DecodeUint64(v []byte) uint64
- func DecodeUint8(v []byte) uint8
- func DecodeValue(val []byte, t T) any
- func DefaultVal[T any]() T
- func Encode(v encoding.BinaryMarshaler) ([]byte, error)
- func EncodeBool(v *bool) []byte
- func EncodeDate(v *Date) []byte
- func EncodeDatetime(v *Datetime) []byte
- func EncodeDecimal128(v *Decimal128) []byte
- func EncodeDecimal64(v *Decimal64) []byte
- func EncodeFixed[T FixedSizeT](v T) []byte
- func EncodeFloat32(v *float32) []byte
- func EncodeFloat64(v *float64) []byte
- func EncodeInt16(v *int16) []byte
- func EncodeInt32(v *int32) []byte
- func EncodeInt64(v *int64) []byte
- func EncodeInt8(v *int8) []byte
- func EncodeJson(v bytejson.ByteJson) ([]byte, error)
- func EncodeSlice[T any](v []T) []byte
- func EncodeSliceWithCap[T any](v []T) []byte
- func EncodeStringSlice(vs []string) []byte
- func EncodeTime(v *Time) []byte
- func EncodeTimestamp(v *Timestamp) []byte
- func EncodeType(v *Type) []byte
- func EncodeUint16(v *uint16) []byte
- func EncodeUint32(v *uint32) []byte
- func EncodeUint64(v *uint64) []byte
- func EncodeUint8(v *uint8) []byte
- func EncodeUuid(v *Uuid) []byte
- func EncodeValue(val any, t T) []byte
- func EqualUuid(src Uuid, dest Uuid) bool
- func GetUnixEpochSecs() int64
- func Int32ToUint32(x int32) uint32
- func IsAllNumber(s *string) bool
- func IsNumber(s *string, idx int) bool
- func JudgeIntervalNumOverflow(num int64, it IntervalType) error
- func LastDay(year int32, month uint8) uint8
- func NewProtoType(oid T) *plan.Type
- func ParseBool(s string) (bool, error)
- func ParseSliceToByteJson(dt []byte) (bytejson.ByteJson, error)
- func ParseStringToByteJson(str string) (bytejson.ByteJson, error)
- func ParseStringToPath(str string) (bytejson.Path, error)
- func ParseValueToBool(num *tree.NumVal) (bool, error)
- func ToNumber(s string) int64
- func TypeSize(oid T) int
- func Uint32ToInt32(ux uint32) int32
- func UnitIsDayOrLarger(it IntervalType) bool
- func UuidToString(muuid Uuid) (string, error)
- func ValidDate(year int32, month, day uint8) bool
- func ValidDatetime(year int32, month, day uint8) bool
- func ValidTime(h, m, s uint64) bool
- func ValidTimeInDay(h, m, s uint8) bool
- func ValidTimestamp(timestamp Timestamp) bool
- func WriteValues(w io.Writer, vals ...any) (n int64, err error)
- type Blockid
- func (b Blockid) Compare(other Blockid) int
- func (b *Blockid) IsEmpty() bool
- func (b *Blockid) Marshal() ([]byte, error)
- func (b *Blockid) MarshalTo(data []byte) (int, error)
- func (b *Blockid) MarshalToSizedBuffer(data []byte) (int, error)
- func (b *Blockid) Offsets() (uint16, uint16)
- func (b *Blockid) ProtoSize() int
- func (b *Blockid) Segment() *Segmentid
- func (b *Blockid) Sequence() uint16
- func (b *Blockid) ShortString() string
- func (b *Blockid) String() string
- func (b *Blockid) Unmarshal(data []byte) error
- type BuiltinNumber
- type Date
- func (d Date) Calendar(full bool) (year int32, month, day uint8, yday uint16)
- func (d Date) Day() uint8
- func (d Date) DayOfWeek() Weekday
- func (d Date) DayOfWeek2() Weekday
- func (d Date) DayOfYear() uint16
- func (d Date) DaysSinceUnixEpoch() int32
- func (d Date) Month() uint8
- func (d Date) Quarter() uint32
- func (d Date) String() string
- func (d Date) ToDatetime() Datetime
- func (d Date) ToTime() Time
- func (d Date) ToTimestamp(loc *time.Location) Timestamp
- func (d Date) Week(mode int) int
- func (d Date) WeekOfYear() (year int32, week uint8)
- func (d Date) WeekOfYear2() uint8
- func (d Date) Year() uint16
- func (d Date) YearMonth() uint32
- func (d Date) YearMonthStr() string
- func (d Date) YearWeek(mode int) (year int, week int)
- type Datetime
- func DatetimeFromClock(year int32, month, day, hour, minute, sec uint8, msec uint32) Datetime
- func DatetimeFromUnix(loc *time.Location, ts int64) Datetime
- func DatetimeFromUnixWithNsec(loc *time.Location, sec int64, nsec int64) Datetime
- func DecodeDatetime(v []byte) Datetime
- func Now(loc *time.Location) Datetime
- func ParseDatetime(s string, scale int32) (Datetime, error)
- func TimestampToDatetime(loc *time.Location, xs []Timestamp, rs []Datetime) ([]Datetime, error)
- func UTC() Datetime
- func (dt Datetime) AddDateTime(addMonth, addYear int64, timeType TimeType) (Datetime, bool)
- func (dt Datetime) AddInterval(nums int64, its IntervalType, timeType TimeType) (Datetime, bool)
- func (dt Datetime) Clock() (hour, minute, sec int8)
- func (dt Datetime) ConvertToGoTime(loc *time.Location) time.Time
- func (dt Datetime) ConvertToMonth(secondDt Datetime) int64
- func (dt Datetime) DateTimeDiffWithUnit(its string, secondDt Datetime) (int64, error)
- func (dt Datetime) DatetimeMinusWithSecond(secondDt Datetime) int64
- func (dt Datetime) Day() uint8
- func (dt Datetime) DayHourStr() string
- func (dt Datetime) DayMicrosecondStr() string
- func (dt Datetime) DayMinuteStr() string
- func (dt Datetime) DayOfWeek() Weekday
- func (dt Datetime) DayOfWeek2() Weekday
- func (dt Datetime) DayOfYear() uint16
- func (dt Datetime) DaySecondStr() string
- func (dt Datetime) Hour() int8
- func (dt Datetime) HourMicrosecondStr() string
- func (dt Datetime) HourMinuteStr() string
- func (dt Datetime) HourSecondStr() string
- func (dt Datetime) MicroSec() int64
- func (dt Datetime) Minute() int8
- func (dt Datetime) MinuteMicrosecondStr() string
- func (dt Datetime) MinuteSecondStr() string
- func (dt Datetime) Month() uint8
- func (dt Datetime) Sec() int8
- func (dt Datetime) SecondMicrosecondStr() string
- func (dt Datetime) SecsSinceUnixEpoch() int64
- func (dt Datetime) String() string
- func (dt Datetime) String2(scale int32) string
- func (dt Datetime) ToDate() Date
- func (dt Datetime) ToDecimal128() Decimal128
- func (dt Datetime) ToDecimal64() Decimal64
- func (dt Datetime) ToTime(scale int32) Time
- func (dt Datetime) ToTimestamp(loc *time.Location) Timestamp
- func (dt Datetime) UnixTimestamp(loc *time.Location) int64
- func (dt Datetime) Week(mode int) int
- func (dt Datetime) WeekOfYear() (int32, uint8)
- func (dt Datetime) Year() uint16
- func (dt Datetime) YearMonthStr() string
- func (dt Datetime) YearWeek(mode int) (year int, week int)
- type Decimal
- type Decimal128
- func Decimal128FromFloat64(x float64, width, scale int32) (y Decimal128, err error)
- func DecodeDecimal128(v []byte) Decimal128
- func Parse128(x string) (y Decimal128, scale int32, err error)
- func ParseDecimal128(x string, width, scale int32) (y Decimal128, err error)
- func ParseDecimal128FromByte(x string, width, scale int32) (y Decimal128, err error)
- func (x Decimal128) Add(y Decimal128, scale1, scale2 int32) (z Decimal128, scale int32, err error)
- func (x Decimal128) Add128(y Decimal128) (Decimal128, error)
- func (x Decimal128) Ceil(scale1, scale2 int32) Decimal128
- func (x Decimal128) Compare(y Decimal128) int
- func (x Decimal128) Div(y Decimal128, scale1, scale2 int32) (z Decimal128, scale int32, err error)
- func (x Decimal128) Div128(y Decimal128) (Decimal128, error)
- func (x Decimal128) Floor(scale1, scale2 int32) Decimal128
- func (x Decimal128) Format(scale int32) string
- func (x Decimal128) Left(n int) (y Decimal128)
- func (x Decimal128) Less(y Decimal128) bool
- func (x Decimal128) Lt(y Decimal128) bool
- func (x *Decimal128) Marshal() ([]byte, error)
- func (x *Decimal128) MarshalTo(data []byte) (int, error)
- func (x *Decimal128) MarshalToSizedBuffer(data []byte) (int, error)
- func (x Decimal128) Minus() Decimal128
- func (x Decimal128) Mod(y Decimal128, scale1, scale2 int32) (z Decimal128, scale int32, err error)
- func (x Decimal128) Mod128(y Decimal128) (Decimal128, error)
- func (x Decimal128) Mul(y Decimal128, scale1, scale2 int32) (z Decimal128, scale int32, err error)
- func (x Decimal128) Mul128(y Decimal128) (Decimal128, error)
- func (x *Decimal128) ProtoSize() int
- func (x Decimal128) Right(n int) (y Decimal128)
- func (x Decimal128) Round(scale1, scale2 int32) Decimal128
- func (x Decimal128) Scale(n int32) (Decimal128, error)
- func (x Decimal128) Sign() bool
- func (x Decimal128) Sub(y Decimal128, scale1, scale2 int32) (z Decimal128, scale int32, err error)
- func (x Decimal128) Sub128(y Decimal128) (Decimal128, error)
- func (x *Decimal128) Unmarshal(data []byte) error
- type Decimal256
- func (x Decimal256) Add(y Decimal256, scale1, scale2 int32) (z Decimal256, scale int32, err error)
- func (x Decimal256) Add256(y Decimal256) (Decimal256, error)
- func (x Decimal256) Compare(y Decimal256) int
- func (x Decimal256) Div(y Decimal256, scale1, scale2 int32) (z Decimal256, scale int32, err error)
- func (x Decimal256) Div256(y Decimal256) (Decimal256, error)
- func (x Decimal256) Format(scale int32) string
- func (x Decimal256) Left(n int) (y Decimal256)
- func (x Decimal256) Less(y Decimal256) bool
- func (x Decimal256) Minus() Decimal256
- func (x Decimal256) Mod(y Decimal256, scale1, scale2 int32) (z Decimal256, scale int32, err error)
- func (x Decimal256) Mod256(y Decimal256) (Decimal256, error)
- func (x Decimal256) Mul(y Decimal256, scale1, scale2 int32) (z Decimal256, scale int32, err error)
- func (x Decimal256) Mul256(y Decimal256) (Decimal256, error)
- func (x Decimal256) Right(n int) (y Decimal256)
- func (x Decimal256) Scale(n int32) (Decimal256, error)
- func (x Decimal256) Sign() bool
- func (x Decimal256) Sub(y Decimal256, scale1, scale2 int32) (z Decimal256, scale int32, err error)
- func (x Decimal256) Sub256(y Decimal256) (Decimal256, error)
- type Decimal64
- func Decimal64FromFloat64(x float64, width, scale int32) (y Decimal64, err error)
- func DecodeDecimal64(v []byte) Decimal64
- func Parse64(x string) (y Decimal64, scale int32, err error)
- func ParseDecimal64(x string, width, scale int32) (y Decimal64, err error)
- func ParseDecimal64FromByte(x string, width, scale int32) (y Decimal64, err error)
- func (x Decimal64) Add(y Decimal64, scale1, scale2 int32) (z Decimal64, scale int32, err error)
- func (x Decimal64) Add64(y Decimal64) (Decimal64, error)
- func (x Decimal64) Ceil(scale1, scale2 int32) Decimal64
- func (x Decimal64) Compare(y Decimal64) int
- func (x Decimal64) Div(y Decimal64, scale1, scale2 int32) (z Decimal64, scale int32, err error)
- func (x Decimal64) Div64(y Decimal64) (Decimal64, error)
- func (x Decimal64) Floor(scale1, scale2 int32) Decimal64
- func (x Decimal64) Format(scale int32) string
- func (x Decimal64) Left(n int) (y Decimal64)
- func (x Decimal64) Less(y Decimal64) bool
- func (x Decimal64) Lt(y Decimal64) bool
- func (x *Decimal64) Marshal() ([]byte, error)
- func (x *Decimal64) MarshalTo(data []byte) (int, error)
- func (x *Decimal64) MarshalToSizedBuffer(data []byte) (int, error)
- func (x Decimal64) Minus() Decimal64
- func (x Decimal64) Mod(y Decimal64, scale1, scale2 int32) (z Decimal64, scale int32, err error)
- func (x Decimal64) Mod64(y Decimal64) (Decimal64, error)
- func (x Decimal64) Mul(y Decimal64, scale1, scale2 int32) (z Decimal64, scale int32, err error)
- func (x Decimal64) Mul64(y Decimal64) (Decimal64, error)
- func (x *Decimal64) ProtoSize() int
- func (x Decimal64) Right(n int) (y Decimal64)
- func (x Decimal64) Round(scale1, scale2 int32) Decimal64
- func (x Decimal64) Scale(n int32) (Decimal64, error)
- func (x Decimal64) Sign() bool
- func (x Decimal64) Sub(y Decimal64, scale1, scale2 int32) (z Decimal64, scale int32, err error)
- func (x Decimal64) Sub64(y Decimal64) (Decimal64, error)
- func (x *Decimal64) Unmarshal(data []byte) error
- type FixedBytes
- type FixedSizeT
- type FixedSizeTExceptStrType
- type Floats
- type IntervalType
- type Ints
- type MockHLCClock
- func (c *MockHLCClock) Get() timestamp.Timestamp
- func (c *MockHLCClock) HasNetworkLatency() bool
- func (c *MockHLCClock) MaxOffset() time.Duration
- func (c *MockHLCClock) Now() (timestamp.Timestamp, timestamp.Timestamp)
- func (c *MockHLCClock) SetNodeID(id uint16)
- func (c *MockHLCClock) Update(m timestamp.Timestamp)
- type Number
- type ObjectBytes
- type OrderedT
- type Packer
- func (p *Packer) Bytes() []byte
- func (p *Packer) EncodeBool(e bool)
- func (p *Packer) EncodeDate(e Date)
- func (p *Packer) EncodeDatetime(e Datetime)
- func (p *Packer) EncodeDecimal128(e Decimal128)
- func (p *Packer) EncodeDecimal64(e Decimal64)
- func (p *Packer) EncodeFloat32(e float32)
- func (p *Packer) EncodeFloat64(e float64)
- func (p *Packer) EncodeInt16(e int16)
- func (p *Packer) EncodeInt32(e int32)
- func (p *Packer) EncodeInt64(e int64)
- func (p *Packer) EncodeInt8(e int8)
- func (p *Packer) EncodeStringType(e []byte)
- func (p *Packer) EncodeTime(e Time)
- func (p *Packer) EncodeTimestamp(e Timestamp)
- func (p *Packer) EncodeUint16(e uint16)
- func (p *Packer) EncodeUint32(e uint32)
- func (p *Packer) EncodeUint64(e uint64)
- func (p *Packer) EncodeUint8(e uint8)
- func (p *Packer) FreeMem()
- func (p *Packer) GetBuf() []byte
- func (p *Packer) Reset()
- type Rowid
- func (r *Rowid) BorrowBlockID() *Blockid
- func (r *Rowid) BorrowSegmentID() *Segmentid
- func (r *Rowid) CloneBlockID() Blockid
- func (r *Rowid) CloneSegmentID() Segmentid
- func (r Rowid) Decode() (Blockid, uint32)
- func (r Rowid) Equal(to Rowid) bool
- func (r Rowid) Ge(than Rowid) bool
- func (r Rowid) GetBlockOffset() uint16
- func (r Rowid) GetObject() ObjectBytes
- func (r Rowid) GetObjectString() string
- func (r Rowid) GetRowOffset() uint32
- func (r Rowid) Great(than Rowid) bool
- func (r Rowid) Le(than Rowid) bool
- func (r Rowid) Less(than Rowid) bool
- func (r Rowid) NotEqual(to Rowid) bool
- func (r *Rowid) SetRowOffset(offset uint32)
- func (r *Rowid) String() string
- type Segmentid
- type T
- func (t T) FixedLength() int
- func (t T) IsDateRelate() bool
- func (t T) IsDecimal() bool
- func (t T) IsFixedLen() bool
- func (t T) IsFloat() bool
- func (t T) IsInteger() bool
- func (t T) IsMySQLString() bool
- func (t T) IsOrdered() bool
- func (t T) IsSignedInt() bool
- func (t T) IsUnsignedInt() bool
- func (t T) OidString() string
- func (t T) String() string
- func (t T) ToType() Type
- func (t T) TypeLen() int
- type TS
- func (ts TS) Compare(rhs TS) int
- func (ts TS) Equal(rhs TS) bool
- func (ts TS) Greater(rhs TS) bool
- func (ts TS) GreaterEq(rhs TS) bool
- func (ts TS) IsEmpty() bool
- func (ts TS) Less(rhs TS) bool
- func (ts TS) LessEq(rhs TS) bool
- func (ts TS) Logical() uint32
- func (ts *TS) Marshal() ([]byte, error)
- func (ts *TS) MarshalTo(data []byte) (int, error)
- func (ts *TS) MarshalToSizedBuffer(data []byte) (int, error)
- func (ts TS) Next() TS
- func (ts TS) Physical() int64
- func (ts TS) Prev() TS
- func (ts *TS) ProtoSize() int
- func (ts TS) ToString() string
- func (ts TS) ToTimestamp() timestamp.Timestamp
- func (ts *TS) Unmarshal(data []byte) error
- type Time
- func DecodeTime(v []byte) Time
- func ParseDecimal128ToTime(input Decimal128, scale1, scale2 int32) (Time, error)
- func ParseDecimal64ToTime(input Decimal64, scale1, scale2 int32) (Time, error)
- func ParseInt64ToTime(input int64, scale int32) (Time, error)
- func ParseTime(s string, scale int32) (Time, error)
- func TimeFromClock(isNegative bool, hour uint64, minute, sec uint8, msec uint32) Time
- func (t Time) AddInterval(nums int64, its IntervalType) (Time, bool)
- func (t Time) ClockFormat() (hour uint64, minute, sec uint8, msec uint64, isNeg bool)
- func (t Time) ConvertToInterval(ctx context.Context, its string) (int64, error)
- func (t Time) Hour() int64
- func (t Time) MicroSec() int64
- func (t Time) Minute() int8
- func (t Time) NumericString(scale int32) string
- func (t Time) Sec() int8
- func (t Time) String() string
- func (t Time) String2(scale int32) string
- func (t Time) ToDate() Date
- func (t Time) ToDatetime(scale int32) Datetime
- func (t Time) ToDecimal128(ctx context.Context, width, scale int32) (Decimal128, error)
- func (t Time) ToDecimal64(ctx context.Context, width, scale int32) (Decimal64, error)
- func (t Time) ToInt64() int64
- type TimeType
- type Timestamp
- func CurrentTimestamp() Timestamp
- func DecodeTimestamp(v []byte) Timestamp
- func FromClockUTC(year int32, month, day, hour, minute, sec uint8, msec uint32) Timestamp
- func FromClockZone(loc *time.Location, year int32, month, day, hour, minute, sec uint8, ...) Timestamp
- func ParseTimestamp(loc *time.Location, s string, scale int32) (Timestamp, error)
- func UnixMicroToTimestamp(ts int64) Timestamp
- func UnixNanoToTimestamp(ts int64) Timestamp
- func UnixToTimestamp(ts int64) Timestamp
- func (ts Timestamp) String() string
- func (ts Timestamp) String2(loc *time.Location, scale int32) string
- func (ts Timestamp) ToDatetime(loc *time.Location) Datetime
- func (ts Timestamp) Unix() int64
- func (ts Timestamp) UnixToDecimal128() (Decimal128, error)
- func (ts Timestamp) UnixToDecimal64() (Decimal64, error)
- func (ts Timestamp) UnixToFloat() float64
- type TsAlloctor
- type Tuple
- type TupleElement
- type Type
- func (t Type) DescString() string
- func (t Type) Eq(b Type) bool
- func (t Type) GetNotNull() bool
- func (t Type) GetSize() int32
- func (t Type) IsBoolean() bool
- func (t Type) IsDecimal() bool
- func (t Type) IsFixedLen() bool
- func (t Type) IsFloat() bool
- func (t Type) IsInt() bool
- func (t Type) IsIntOrUint() bool
- func (t Type) IsNumericOrTemporal() bool
- func (t Type) IsTemporal() bool
- func (t Type) IsTuple() bool
- func (t Type) IsUInt() bool
- func (t Type) IsVarlen() bool
- func (t *Type) Marshal() ([]byte, error)
- func (t *Type) MarshalBinary() ([]byte, error)
- func (t *Type) MarshalTo(data []byte) (int, error)
- func (t *Type) MarshalToSizedBuffer(data []byte) (int, error)
- func (t *Type) ProtoSize() int
- func (t *Type) SetNotNull(b bool)
- func (t Type) String() string
- func (t Type) TypeSize() int
- func (t *Type) Unmarshal(data []byte) error
- func (t *Type) UnmarshalBinary(data []byte) error
- type UInts
- type Uuid
- func (d Uuid) ClockSequence() int
- func (d Uuid) Compare(other Uuid) int
- func (d Uuid) Eq(other Uuid) bool
- func (d Uuid) Ge(other Uuid) bool
- func (d Uuid) Gt(other Uuid) bool
- func (d Uuid) Le(other Uuid) bool
- func (d Uuid) Lt(other Uuid) bool
- func (d *Uuid) Marshal() ([]byte, error)
- func (d *Uuid) MarshalTo(data []byte) (int, error)
- func (d *Uuid) MarshalToSizedBuffer(data []byte) (int, error)
- func (d Uuid) Ne(other Uuid) bool
- func (d *Uuid) ProtoSize() int
- func (d Uuid) ToString() string
- func (d *Uuid) Unmarshal(data []byte) error
- type Varlena
- func (v *Varlena) ByteSlice() []byte
- func (v *Varlena) GetByteSlice(area []byte) []byte
- func (v *Varlena) GetString(area []byte) string
- func (v *Varlena) IsSmall() bool
- func (v *Varlena) OffsetLen() (uint32, uint32)
- func (v *Varlena) Reset()
- func (v *Varlena) SetOffsetLen(voff, vlen uint32)
- func (v *Varlena) U32Slice() []uint32
- func (v *Varlena) UnsafePtr() unsafe.Pointer
- type WeekBehaviour
- type Weekday
Constants ¶
const ( VarlenaInlineSize = 23 VarlenaSize = 24 MaxStringSize = 10485760 VarlenaBigHdr = 0xffffffff MaxVarcharLen = 65535 MaxCharLen = 255 MaxBinaryLen = 255 MaxVarBinaryLen = 65535 )
const ( MaxDateYear = 9999 MinDateYear = 1 MaxMonthInYear = 12 MinMonthInYear = 1 )
const ( DateType = 0 DateTimeType = 1 TimeStampType = 2 )
const ( Start = iota YearState MonthState DayState HourState MinuteState SecondState MsState End )
const ( // WeekMondayFirst: set Monday as first day of week; otherwise Sunday is first day of week WeekMondayFirst WeekBehaviour = 1 // WeekYear: If set, Week is in range 1-53, otherwise Week is in range 0-53. // Week 0 is returned for the the last week of the previous year (for // a date at start of january) In this case one can get 53 for the // first week of next year. This flag ensures that the week is // relevant for the given year. Note that this flag is only // releveant if WEEK_JANUARY is not set. WeekYear = 2 //WeekFirstWeekday: If not set, Weeks are numbered according to ISO 8601:1988. // If set, the week that contains the first 'first-day-of-week' is week 1. // ISO 8601:1988 means that if the week containing January 1 has // four or more days in the new year, then it is week 1; // Otherwise it is the last week of the previous year, and the next week is week 1. WeekFirstWeekday = 4 )
const ( NanoSecsPerSec = 1000000000 // 10^9 MillisecsPerSec = 1000 // 10^3 MaxDatetimeYear = 9999 MinDatetimeYear = 1 )
const ( TSize int = int(unsafe.Sizeof(Type{})) DateSize int = 4 TimeSize int = 8 DatetimeSize int = 8 TimestampSize int = 8 Decimal64Size int = 8 Decimal128Size int = 16 UuidSize int = 16 )
const ( // Time range is [-2562047787:59:59.999999,2562047787:59:59.999999] // This is the max hour that int64 with solution msec can present // (9223372036854775807(max int64)/1000000(msec) - 1)/3600(sec per hour) - 1 = 2562047787 MinHourInTime, MaxHourInTime = 0, 2562047787 MinInputIntTime, MaxInputIntTime = -25620477875959, 25620477875959 )
const ( TxnTsSize = 12 RowidSize = 24 BlockidSize = 20 )
const IntervalNumMAX = int64(^uint64(0) >> 21)
const ObjectBytesSize = 18
const PackerMemUnit = 64
const ( // ZeroDatetime is the zero value for date Time '0000-01-01 00:00:00'. ZeroDatetime = Datetime(0) )
Variables ¶
var DecodeTuple = decodeTuple
var (
FillString = []string{"", "0", "00", "000", "0000", "00000", "000000", "0000000"}
)
var FloatHigh = float64(1<<63) * 2
var OneSecInMicroSeconds = uint32(1000000)
var Pow10 = [20]uint64{
1,
10,
100,
1000,
10000,
100000,
1000000,
10000000,
100000000,
1000000000,
10000000000,
100000000000,
1000000000000,
10000000000000,
100000000000000,
1000000000000000,
10000000000000000,
100000000000000000,
1000000000000000000,
10000000000000000000,
}
var Types map[string]T = map[string]T{ "bool": T_bool, "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, "decimal256": T_decimal256, "float": T_float32, "double": T_float64, "date": T_date, "datetime": T_datetime, "time": T_time, "timestamp": T_timestamp, "interval": T_interval, "char": T_char, "varchar": T_varchar, "binary": T_binary, "varbinary": T_varbinary, "json": T_json, "text": T_text, "blob": T_blob, "uuid": T_uuid, "transaction timestamp": T_TS, "rowid": T_Rowid, "blockid": T_Blockid, }
Functions ¶
func AppendBoolToByteArray ¶ added in v0.5.0
func BoolToIntString ¶ added in v0.6.0
ToIntString print out 1 or 0 as true/false.
func CharsetType ¶ added in v0.6.0
func CompareBlockidBlockidAligned ¶ added in v0.8.0
func CompareDecimal128 ¶ added in v0.6.0
func CompareDecimal128(x Decimal128, y Decimal128) int64
func CompareDecimal128WithScale ¶ added in v0.8.0
func CompareDecimal128WithScale(x, y Decimal128, scale1, scale2 int32) int64
func CompareDecimal256 ¶ added in v0.8.0
func CompareDecimal256(x Decimal256, y Decimal256) int64
func CompareDecimal64 ¶ added in v0.6.0
func CompareDecimal64WithScale ¶ added in v0.8.0
func CompareRowidRowidAligned ¶ added in v0.6.0
func CompareTSTSAligned ¶ added in v0.6.0
func CompareUuid ¶ added in v0.6.0
func Decimal128ToFloat64 ¶ added in v0.8.0
func Decimal128ToFloat64(x Decimal128, scale int32) float64
func Decimal64ToFloat64 ¶ added in v0.8.0
func DecodeBool ¶ added in v0.6.0
func DecodeFixed ¶ added in v0.6.0
func DecodeFixed[T FixedSizeT](v []byte) T
func DecodeFloat32 ¶ added in v0.6.0
func DecodeFloat64 ¶ added in v0.6.0
func DecodeInt16 ¶ added in v0.6.0
func DecodeInt32 ¶ added in v0.6.0
func DecodeInt64 ¶ added in v0.6.0
func DecodeInt8 ¶ added in v0.6.0
func DecodeJson ¶ added in v0.6.0
func DecodeSlice ¶ added in v0.6.0
func DecodeStringSlice ¶ added in v0.6.0
func DecodeUint16 ¶ added in v0.6.0
func DecodeUint32 ¶ added in v0.6.0
func DecodeUint64 ¶ added in v0.6.0
func DecodeUint8 ¶ added in v0.6.0
func DecodeValue ¶ added in v0.6.0
func EncodeBool ¶ added in v0.6.0
func EncodeDate ¶ added in v0.6.0
func EncodeDatetime ¶ added in v0.6.0
func EncodeDecimal128 ¶ added in v0.6.0
func EncodeDecimal128(v *Decimal128) []byte
func EncodeDecimal64 ¶ added in v0.6.0
func EncodeFixed ¶ added in v0.6.0
func EncodeFixed[T FixedSizeT](v T) []byte
func EncodeFloat32 ¶ added in v0.6.0
func EncodeFloat64 ¶ added in v0.6.0
func EncodeInt16 ¶ added in v0.6.0
func EncodeInt32 ¶ added in v0.6.0
func EncodeInt64 ¶ added in v0.6.0
func EncodeInt8 ¶ added in v0.6.0
func EncodeSlice ¶ added in v0.6.0
func EncodeSliceWithCap ¶ added in v0.6.0
func EncodeStringSlice ¶ added in v0.6.0
func EncodeTime ¶ added in v0.6.0
func EncodeTimestamp ¶ added in v0.6.0
func EncodeType ¶ added in v0.6.0
func EncodeUint16 ¶ added in v0.6.0
func EncodeUint32 ¶ added in v0.6.0
func EncodeUint64 ¶ added in v0.6.0
func EncodeUint8 ¶ added in v0.6.0
func EncodeUuid ¶ added in v0.6.0
func EncodeValue ¶ added in v0.6.0
func GetUnixEpochSecs ¶ added in v0.7.0
func GetUnixEpochSecs() int64
func Int32ToUint32 ¶ added in v0.8.0
func IsAllNumber ¶ added in v0.7.0
func JudgeIntervalNumOverflow ¶ added in v0.5.0
func JudgeIntervalNumOverflow(num int64, it IntervalType) error
func NewProtoType ¶ added in v0.6.0
func ParseSliceToByteJson ¶ added in v0.6.0
func ParseStringToByteJson ¶ added in v0.6.0
func Uint32ToInt32 ¶ added in v0.8.0
func UnitIsDayOrLarger ¶ added in v0.5.0
func UnitIsDayOrLarger(it IntervalType) bool
UnitIsDayOrLarger if interval type unit is day or larger, we return true else return false use to judge a string whether it needs to become date/datetime type when we use date_add/sub(str string, interval type)
func UuidToString ¶ added in v0.6.0
func ValidDatetime ¶ added in v0.6.0
date[0001-01-01 00:00:00 to 9999-12-31 23:59:59]
func ValidTimeInDay ¶ added in v0.6.0
validTimeInDay return true if hour, minute and second can be a time during a day
func ValidTimestamp ¶ added in v0.5.0
Types ¶
type Blockid ¶ added in v0.8.0
type Blockid [BlockidSize]byte
Blockid
func BuildTestBlockid ¶ added in v0.8.0
BuildTestBlockid used only in unit test
func (*Blockid) MarshalToSizedBuffer ¶ added in v0.8.0
MarshalToSizedBuffer is used by gogoproto.
func (*Blockid) ShortString ¶ added in v0.8.0
type BuiltinNumber ¶ added in v0.6.0
type Date ¶
type Date int32
func DateFromCalendar ¶ added in v0.7.0
func DecodeDate ¶ added in v0.6.0
func ParseDateCast ¶ added in v0.5.0
rewrite ParseDateCast, don't use regexp, that's too slow the format we need to support: 1.yyyy-mm-dd hh:mm:ss.ms 2.yyyy-mm-dd 3.yyyymmdd
func (Date) DayOfWeek2 ¶ added in v0.8.0
DayOfWeek2 return the day of the week counting from Monday
func (Date) DaysSinceUnixEpoch ¶ added in v0.7.0
func (Date) ToDatetime ¶ added in v0.6.0
func (Date) Week ¶ added in v0.6.0
Week (00..53), where Sunday is the first day of the week; WEEK() mode 0 Week (00..53), where Monday is the first day of the week; WEEK() mode 1
func (Date) WeekOfYear ¶
func (Date) WeekOfYear2 ¶ added in v0.5.0
func (Date) YearMonthStr ¶ added in v0.5.0
type Datetime ¶
type Datetime int64
func DatetimeFromClock ¶ added in v0.7.0
func DatetimeFromUnix ¶ added in v0.7.0
func DatetimeFromUnixWithNsec ¶ added in v0.7.0
func DecodeDatetime ¶ added in v0.6.0
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) now support mm/dd/hh/mm/ss can be single number 3. yyyymmddhhmmss(.msec) during parsing, the Datetime value will be rounded(away from zero) to the predefined scale, for example: Datetime(3) input string parsing result
"1999-09-09 11:11:11.1234" "1999-09-09 11:11:11.123" "1999-09-09 11:11:11.1235" "1999-09-09 11:11:11.124" "1999-09-09 11:11:11.9994" "1999-09-09 11:11:11.999" "1999-09-09 11:11:11.9995" "1999-09-09 11:11:12.000"
func TimestampToDatetime ¶ added in v0.5.0
func (Datetime) AddDateTime ¶ added in v0.5.0
func (Datetime) AddInterval ¶ added in v0.5.0
AddInterval now date or datetime use the function to add/sub date, we need a bool arg to tell isDate/isDatetime date/datetime have different regions, so we don't use same valid function return type bool means the if the date/datetime is valid
func (Datetime) ConvertToGoTime ¶ added in v0.5.0
func (Datetime) ConvertToMonth ¶ added in v0.6.0
func (Datetime) DateTimeDiffWithUnit ¶ added in v0.6.0
func (Datetime) DatetimeMinusWithSecond ¶ added in v0.6.0
func (Datetime) DayHourStr ¶ added in v0.5.0
func (Datetime) DayMicrosecondStr ¶ added in v0.5.0
func (Datetime) DayMinuteStr ¶ added in v0.5.0
func (Datetime) DayOfWeek2 ¶ added in v0.8.0
func (Datetime) DaySecondStr ¶ added in v0.5.0
func (Datetime) HourMicrosecondStr ¶ added in v0.5.0
func (Datetime) HourMinuteStr ¶ added in v0.5.0
func (Datetime) HourSecondStr ¶ added in v0.5.0
func (Datetime) MinuteMicrosecondStr ¶ added in v0.5.0
func (Datetime) MinuteSecondStr ¶ added in v0.5.0
func (Datetime) SecondMicrosecondStr ¶ added in v0.5.0
func (Datetime) SecsSinceUnixEpoch ¶ added in v0.7.0
func (Datetime) ToDecimal128 ¶ added in v0.8.0
func (dt Datetime) ToDecimal128() Decimal128
func (Datetime) ToDecimal64 ¶ added in v0.8.0
func (Datetime) ToTime ¶ added in v0.6.0
We need to truncate the part after scale position when cast between different scale.
func (Datetime) ToTimestamp ¶ added in v0.6.0
func (Datetime) UnixTimestamp ¶ added in v0.5.0
func (Datetime) WeekOfYear ¶ added in v0.5.0
func (Datetime) YearMonthStr ¶ added in v0.5.0
type Decimal ¶ added in v0.5.0
type Decimal interface { Decimal64 | Decimal128 | Decimal256 }
type Decimal128 ¶
func Decimal128FromFloat64 ¶ added in v0.6.0
func Decimal128FromFloat64(x float64, width, scale int32) (y Decimal128, err error)
func DecodeDecimal128 ¶ added in v0.6.0
func DecodeDecimal128(v []byte) Decimal128
func ParseDecimal128 ¶ added in v0.8.0
func ParseDecimal128(x string, width, scale int32) (y Decimal128, err error)
func ParseDecimal128FromByte ¶ added in v0.8.0
func ParseDecimal128FromByte(x string, width, scale int32) (y Decimal128, err error)
func (Decimal128) Add ¶ added in v0.6.0
func (x Decimal128) Add(y Decimal128, scale1, scale2 int32) (z Decimal128, scale int32, err error)
func (Decimal128) Add128 ¶ added in v0.8.0
func (x Decimal128) Add128(y Decimal128) (Decimal128, error)
func (Decimal128) Ceil ¶ added in v0.8.0
func (x Decimal128) Ceil(scale1, scale2 int32) Decimal128
func (Decimal128) Compare ¶ added in v0.6.0
func (x Decimal128) Compare(y Decimal128) int
func (Decimal128) Div ¶ added in v0.6.0
func (x Decimal128) Div(y Decimal128, scale1, scale2 int32) (z Decimal128, scale int32, err error)
func (Decimal128) Div128 ¶ added in v0.8.0
func (x Decimal128) Div128(y Decimal128) (Decimal128, error)
func (Decimal128) Floor ¶ added in v0.8.0
func (x Decimal128) Floor(scale1, scale2 int32) Decimal128
func (Decimal128) Format ¶ added in v0.8.0
func (x Decimal128) Format(scale int32) string
func (Decimal128) Left ¶ added in v0.8.0
func (x Decimal128) Left(n int) (y Decimal128)
func (Decimal128) Less ¶ added in v0.8.0
func (x Decimal128) Less(y Decimal128) bool
func (Decimal128) Lt ¶ added in v0.6.0
func (x Decimal128) Lt(y Decimal128) bool
func (*Decimal128) Marshal ¶ added in v0.8.0
func (x *Decimal128) Marshal() ([]byte, error)
Marshal is used by gogoproto.
func (*Decimal128) MarshalTo ¶ added in v0.8.0
func (x *Decimal128) MarshalTo(data []byte) (int, error)
MarshalTo is used by gogoproto.
func (*Decimal128) MarshalToSizedBuffer ¶ added in v0.8.0
func (x *Decimal128) MarshalToSizedBuffer(data []byte) (int, error)
func (Decimal128) Minus ¶ added in v0.8.0
func (x Decimal128) Minus() Decimal128
func (Decimal128) Mod ¶ added in v0.8.0
func (x Decimal128) Mod(y Decimal128, scale1, scale2 int32) (z Decimal128, scale int32, err error)
func (Decimal128) Mod128 ¶ added in v0.8.0
func (x Decimal128) Mod128(y Decimal128) (Decimal128, error)
func (Decimal128) Mul ¶ added in v0.6.0
func (x Decimal128) Mul(y Decimal128, scale1, scale2 int32) (z Decimal128, scale int32, err error)
func (Decimal128) Mul128 ¶ added in v0.8.0
func (x Decimal128) Mul128(y Decimal128) (Decimal128, error)
func (*Decimal128) ProtoSize ¶ added in v0.8.0
func (x *Decimal128) ProtoSize() int
ProtoSize is used by gogoproto.
func (Decimal128) Right ¶ added in v0.8.0
func (x Decimal128) Right(n int) (y Decimal128)
func (Decimal128) Round ¶ added in v0.8.0
func (x Decimal128) Round(scale1, scale2 int32) Decimal128
func (Decimal128) Scale ¶ added in v0.8.0
func (x Decimal128) Scale(n int32) (Decimal128, error)
func (Decimal128) Sign ¶ added in v0.8.0
func (x Decimal128) Sign() bool
func (Decimal128) Sub ¶ added in v0.6.0
func (x Decimal128) Sub(y Decimal128, scale1, scale2 int32) (z Decimal128, scale int32, err error)
func (Decimal128) Sub128 ¶ added in v0.8.0
func (x Decimal128) Sub128(y Decimal128) (Decimal128, error)
func (*Decimal128) Unmarshal ¶ added in v0.8.0
func (x *Decimal128) Unmarshal(data []byte) error
Unmarshal is used by gogoproto.
type Decimal256 ¶ added in v0.8.0
func (Decimal256) Add ¶ added in v0.8.0
func (x Decimal256) Add(y Decimal256, scale1, scale2 int32) (z Decimal256, scale int32, err error)
func (Decimal256) Add256 ¶ added in v0.8.0
func (x Decimal256) Add256(y Decimal256) (Decimal256, error)
func (Decimal256) Compare ¶ added in v0.8.0
func (x Decimal256) Compare(y Decimal256) int
func (Decimal256) Div ¶ added in v0.8.0
func (x Decimal256) Div(y Decimal256, scale1, scale2 int32) (z Decimal256, scale int32, err error)
func (Decimal256) Div256 ¶ added in v0.8.0
func (x Decimal256) Div256(y Decimal256) (Decimal256, error)
func (Decimal256) Format ¶ added in v0.8.0
func (x Decimal256) Format(scale int32) string
func (Decimal256) Left ¶ added in v0.8.0
func (x Decimal256) Left(n int) (y Decimal256)
func (Decimal256) Less ¶ added in v0.8.0
func (x Decimal256) Less(y Decimal256) bool
func (Decimal256) Minus ¶ added in v0.8.0
func (x Decimal256) Minus() Decimal256
func (Decimal256) Mod ¶ added in v0.8.0
func (x Decimal256) Mod(y Decimal256, scale1, scale2 int32) (z Decimal256, scale int32, err error)
func (Decimal256) Mod256 ¶ added in v0.8.0
func (x Decimal256) Mod256(y Decimal256) (Decimal256, error)
func (Decimal256) Mul ¶ added in v0.8.0
func (x Decimal256) Mul(y Decimal256, scale1, scale2 int32) (z Decimal256, scale int32, err error)
func (Decimal256) Mul256 ¶ added in v0.8.0
func (x Decimal256) Mul256(y Decimal256) (Decimal256, error)
func (Decimal256) Right ¶ added in v0.8.0
func (x Decimal256) Right(n int) (y Decimal256)
func (Decimal256) Scale ¶ added in v0.8.0
func (x Decimal256) Scale(n int32) (Decimal256, error)
func (Decimal256) Sign ¶ added in v0.8.0
func (x Decimal256) Sign() bool
func (Decimal256) Sub ¶ added in v0.8.0
func (x Decimal256) Sub(y Decimal256, scale1, scale2 int32) (z Decimal256, scale int32, err error)
func (Decimal256) Sub256 ¶ added in v0.8.0
func (x Decimal256) Sub256(y Decimal256) (Decimal256, error)
type Decimal64 ¶
type Decimal64 uint64
func Decimal64FromFloat64 ¶ added in v0.6.0
func DecodeDecimal64 ¶ added in v0.6.0
func ParseDecimal64 ¶ added in v0.8.0
func ParseDecimal64FromByte ¶ added in v0.8.0
func (*Decimal64) MarshalToSizedBuffer ¶ added in v0.8.0
MarshalToSizedBuffer is used by gogoproto.
type FixedBytes ¶ added in v0.6.0
Fixed bytes. Deciaml64/128 and Varlena are not included because they has special meanings. In general you cannot compare them as bytes.
type FixedSizeT ¶ added in v0.6.0
type FixedSizeT interface { FixedSizeTExceptStrType | Varlena }
FixedSized types in our type system. Esp, Varlena.
type FixedSizeTExceptStrType ¶ added in v0.8.0
type IntervalType ¶ added in v0.5.0
type IntervalType int8
const ( IntervalTypeInvalid IntervalType = iota MicroSecond Second Minute Hour Day Week Month Quarter Year Second_MicroSecond Minute_MicroSecond Minute_Second Hour_MicroSecond Hour_Second Hour_Minute Day_MicroSecond Day_Second Day_Minute Day_Hour Year_Month IntervalTypeMax )
func IntervalTypeOf ¶ added in v0.5.0
func IntervalTypeOf(s string) (IntervalType, error)
func NormalizeInterval ¶ added in v0.5.0
func NormalizeInterval(s string, it IntervalType) (ret int64, rettype IntervalType, err error)
func (IntervalType) String ¶ added in v0.5.0
func (it IntervalType) String() string
type MockHLCClock ¶ added in v0.6.0
type MockHLCClock struct {
// contains filtered or unexported fields
}
func NewMockHLCClock ¶ added in v0.6.0
func NewMockHLCClock(start int64) *MockHLCClock
Just for test , start >= 1
func (*MockHLCClock) Get ¶ added in v0.6.0
func (c *MockHLCClock) Get() timestamp.Timestamp
TODO::will be removed
func (*MockHLCClock) HasNetworkLatency ¶ added in v0.6.0
func (c *MockHLCClock) HasNetworkLatency() bool
func (*MockHLCClock) MaxOffset ¶ added in v0.6.0
func (c *MockHLCClock) MaxOffset() time.Duration
func (*MockHLCClock) Now ¶ added in v0.6.0
func (c *MockHLCClock) Now() (timestamp.Timestamp, timestamp.Timestamp)
func (*MockHLCClock) SetNodeID ¶ added in v0.6.0
func (c *MockHLCClock) SetNodeID(id uint16)
func (*MockHLCClock) Update ¶ added in v0.6.0
func (c *MockHLCClock) Update(m timestamp.Timestamp)
type ObjectBytes ¶ added in v0.8.0
type ObjectBytes = [ObjectBytesSize]byte
type Packer ¶ added in v0.8.0
type Packer struct {
// contains filtered or unexported fields
}
func (*Packer) EncodeBool ¶ added in v0.8.0
func (*Packer) EncodeDate ¶ added in v0.8.0
func (*Packer) EncodeDatetime ¶ added in v0.8.0
func (*Packer) EncodeDecimal128 ¶ added in v0.8.0
func (p *Packer) EncodeDecimal128(e Decimal128)
func (*Packer) EncodeDecimal64 ¶ added in v0.8.0
func (*Packer) EncodeFloat32 ¶ added in v0.8.0
func (*Packer) EncodeFloat64 ¶ added in v0.8.0
func (*Packer) EncodeInt16 ¶ added in v0.8.0
func (*Packer) EncodeInt32 ¶ added in v0.8.0
func (*Packer) EncodeInt64 ¶ added in v0.8.0
func (*Packer) EncodeInt8 ¶ added in v0.8.0
func (*Packer) EncodeStringType ¶ added in v0.8.0
func (*Packer) EncodeTime ¶ added in v0.8.0
func (*Packer) EncodeTimestamp ¶ added in v0.8.0
func (*Packer) EncodeUint16 ¶ added in v0.8.0
func (*Packer) EncodeUint32 ¶ added in v0.8.0
func (*Packer) EncodeUint64 ¶ added in v0.8.0
func (*Packer) EncodeUint8 ¶ added in v0.8.0
type Rowid ¶ added in v0.6.0
Rowid
func BuildTestRowid ¶ added in v0.8.0
BuildTestRowid used only in unit test.
func RandomRowid ¶ added in v0.8.0
func RandomRowid() Rowid
func (*Rowid) BorrowBlockID ¶ added in v0.8.0
BorrowBlockID borrows block id from row id.
func (*Rowid) BorrowSegmentID ¶ added in v0.8.0
BorrowSegmentID borrows segment id from row id.
func (*Rowid) CloneBlockID ¶ added in v0.8.0
CloneBlockID clones the block id from row id.
func (*Rowid) CloneSegmentID ¶ added in v0.8.0
CloneSegmentID clones segment id from row id.
func (Rowid) GetBlockOffset ¶ added in v0.8.0
func (Rowid) GetObject ¶ added in v0.8.0
func (r Rowid) GetObject() ObjectBytes
func (Rowid) GetObjectString ¶ added in v0.8.0
func (Rowid) GetRowOffset ¶ added in v0.8.0
func (*Rowid) SetRowOffset ¶ added in v0.8.0
type T ¶
type T uint8
const ( // any family T_any T = 0 T_star T = 1 // bool family T_bool T = 10 // numeric/integer family T_int8 T = 20 T_int16 T = 21 T_int32 T = 22 T_int64 T = 23 T_int128 T = 24 T_uint8 T = 25 T_uint16 T = 26 T_uint32 T = 27 T_uint64 T = 28 T_uint128 T = 29 // numeric/float family T_float32 T = 30 T_float64 T = 31 // numeric/decimals T_decimal64 T = 32 T_decimal128 T = 33 T_decimal256 T = 34 // date and time T_date T = 50 T_time T = 51 T_datetime T = 52 T_timestamp T = 53 T_interval T = 54 // string family T_char T = 60 T_varchar T = 61 T_json T = 62 T_uuid T = 63 T_binary T = 64 T_varbinary T = 65 // blobs T_blob T = 70 T_text T = 71 // Transaction TS T_TS T = 100 T_Rowid T = 101 T_Blockid T = 102 // system family T_tuple T = 201 )
func (T) FixedLength ¶
FixedLength dangerous code, use TypeLen() if you don't want -8, -16, -24
func (T) IsDateRelate ¶ added in v0.8.0
func (T) IsDecimal ¶ added in v0.8.0
IsDecimal return true if the types.T is decimal64 or decimal128
func (T) IsFixedLen ¶ added in v0.8.0
func (T) IsInteger ¶ added in v0.8.0
IsInteger if expr type is integer return true,else return false
func (T) IsMySQLString ¶ added in v0.8.0
IsMySQLString return true if the types.T is a MySQL string type (https://dev.mysql.com/doc/refman/8.0/en/string-types.html) NOTE: types.IsVarlen() and t.IsMySQLString() are different. t.IsMySQLString() doesn't have T_Json type.
func (T) IsSignedInt ¶ added in v0.8.0
IsSignedInt return true if the types.T is Signed integer type
func (T) IsUnsignedInt ¶ added in v0.8.0
IsUnsignedInt return true if the types.T is UnSigned integer type
type TS ¶ added in v0.6.0
timestamp for transaction: physical time (higher 8 bytes) + logical (lower 4 bytes) See txts.go for impl.
var SystemDBTS TS
Why this was in package types?
func NextGlobalTsForTest ¶ added in v0.6.0
func NextGlobalTsForTest() TS
func StringToTS ¶ added in v0.6.0
func TimestampToTS ¶ added in v0.6.0
TODO::need to take "NodeID" account into
func (*TS) MarshalToSizedBuffer ¶ added in v0.8.0
MarshalToSizedBuffer is used by gogoproto.
func (TS) Physical ¶ added in v0.6.0
Transaction ts contains a physical ts in higher 8 bytes and a logical in lower 4 bytes. higher lower in little ending sense.
func (TS) ToTimestamp ¶ added in v0.6.0
type Time ¶ added in v0.6.0
type Time int64
func DecodeTime ¶ added in v0.6.0
func ParseDecimal128ToTime ¶ added in v0.8.0
func ParseDecimal128ToTime(input Decimal128, scale1, scale2 int32) (Time, error)
func ParseDecimal64ToTime ¶ added in v0.8.0
func ParseInt64ToTime ¶ added in v0.6.0
func ParseTime ¶ added in v0.6.0
During parsing, if the input length of msec is larger than predefined scale, it will be rounded eg.
Time(3) input string parsing result "11:11:11.1234" "11:11:11.123" "11:11:11.1235" "11:11:11.124" "11:11:11.9994" "11:11:11.999" "11:11:11.9995" "11:11:12.000" "-11:11:11.1235" "-11:11:11.124" "-11:11:11.9995" "-11:11:12.000"
func TimeFromClock ¶ added in v0.7.0
func (Time) AddInterval ¶ added in v0.6.0
func (t Time) AddInterval(nums int64, its IntervalType) (Time, bool)
AddInterval now date or time use the function to add/sub date, return type bool means the if the time is valid
func (Time) ClockFormat ¶ added in v0.6.0
ClockFormat: symbol part/hour part/minute part/second part/msecond part
func (Time) ConvertToInterval ¶ added in v0.6.0
func (Time) NumericString ¶ added in v0.6.0
Format: hhmmss.msec TODO: add the carry when truncate
func (Time) ToDatetime ¶ added in v0.6.0
We need to truncate the part after scale position when cast between different scale.
func (Time) ToDecimal128 ¶ added in v0.6.0
func (Time) ToDecimal64 ¶ added in v0.6.0
type Timestamp ¶ added in v0.5.0
type Timestamp int64
var TimestampMaxValue Timestamp
var TimestampMinValue Timestamp
func CurrentTimestamp ¶ added in v0.6.0
func CurrentTimestamp() Timestamp
func DecodeTimestamp ¶ added in v0.6.0
func FromClockUTC ¶ added in v0.5.0
FromClockUTC gets the utc time value in Timestamp
func FromClockZone ¶ added in v0.6.0
func FromClockZone(loc *time.Location, year int32, month, day, hour, minute, sec uint8, msec uint32) Timestamp
FromClockZone gets the local time value in Timestamp
func ParseTimestamp ¶ added in v0.5.0
ParseTimestamp will parse a string to be a Timestamp Support Format: 1. all the Date value 2. yyyy-mm-dd hh:mm:ss(.msec) 3. yyyymmddhhmmss(.msec)
func UnixMicroToTimestamp ¶ added in v0.6.0
func UnixNanoToTimestamp ¶ added in v0.7.0
func UnixToTimestamp ¶ added in v0.5.0
func (Timestamp) String2 ¶ added in v0.5.0
String2 stringify timestamp, including its fractional seconds precision part(fsp)
func (Timestamp) ToDatetime ¶ added in v0.8.0
func (Timestamp) UnixToDecimal128 ¶ added in v0.6.0
func (ts Timestamp) UnixToDecimal128() (Decimal128, error)
func (Timestamp) UnixToDecimal64 ¶ added in v0.8.0
func (Timestamp) UnixToFloat ¶ added in v0.6.0
type TsAlloctor ¶ added in v0.6.0
type TsAlloctor struct {
// contains filtered or unexported fields
}
var ( //just for test GlobalTsAlloctor *TsAlloctor )
TAE test infra, should move out
func NewTsAlloctor ¶ added in v0.6.0
func NewTsAlloctor(clock clock.Clock) *TsAlloctor
func (*TsAlloctor) Alloc ¶ added in v0.6.0
func (alloc *TsAlloctor) Alloc() TS
func (*TsAlloctor) SetStart ¶ added in v0.6.0
func (alloc *TsAlloctor) SetStart(start TS)
type Tuple ¶ added in v0.6.0
type Tuple []TupleElement
type TupleElement ¶ added in v0.6.0
type TupleElement any
type Type ¶
type Type struct { Oid T // XXX Dummies. T is uint8, make it 4 bytes aligned, otherwise, it may contain // garbage data. In theory these unused garbage should not be a problem, but // it is. Give it a name will zero fill it ... Charset uint8 Size int32 // Width means max Display width for float and double, char and varchar // todo: need to add new attribute DisplayWidth ? Width int32 // Scale means number of fractional digits for decimal, timestamp, float, etc. Scale int32 // contains filtered or unexported fields }
var CompoundKeyType Type
CompoundKeyType -- this is simply deadly wrong thing.
func DecodeType ¶ added in v0.6.0
func MockColTypes ¶ added in v0.6.0
func (Type) DescString ¶ added in v0.7.0
func (Type) GetNotNull ¶ added in v0.8.0
func (Type) IsFixedLen ¶ added in v0.6.0
func (Type) IsIntOrUint ¶ added in v0.6.0
func (Type) IsNumericOrTemporal ¶ added in v0.8.0
func (Type) IsTemporal ¶ added in v0.8.0
func (*Type) MarshalBinary ¶ added in v0.8.0
func (*Type) MarshalToSizedBuffer ¶ added in v0.8.0
MarshalToSizedBuffer is used by gogoproto.
func (*Type) SetNotNull ¶ added in v0.8.0
func (*Type) UnmarshalBinary ¶ added in v0.8.0
type Uuid ¶ added in v0.6.0
type Uuid [16]byte
UUID is Version 1 UUID based on the current NodeID and clock sequence, and the current time.
func DecodeUuid ¶ added in v0.6.0
func (Uuid) ClockSequence ¶ added in v0.6.0
func (*Uuid) MarshalToSizedBuffer ¶ added in v0.8.0
MarshalToSizedBuffer is used by gogoproto.
type Varlena ¶ added in v0.6.0
type Varlena [VarlenaSize]byte
func BuildVarlena ¶ added in v0.6.0
func (*Varlena) GetByteSlice ¶ added in v0.6.0
For short slice, this one will return a slice stored internal in the varlena. Caller must ensure that v has a longer life span than the returned byte slice.
Main user of Varlena is vector. v that comes from vector.Data will be fine.
func (*Varlena) SetOffsetLen ¶ added in v0.6.0
type WeekBehaviour ¶ added in v0.8.0
type WeekBehaviour uint