types

package
v0.7.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 18, 2023 License: Apache-2.0 Imports: 25 Imported by: 1

Documentation

Index

Constants

View Source
const (
	VarlenaInlineSize = 23
	VarlenaSize       = 24
	MaxStringSize     = 10485760
	VarlenaBigHdr     = 0xffffffff
	MaxVarcharLen     = 65535
	MaxCharLen        = 255
)
View Source
const (
	MaxDateYear    = 9999
	MinDateYear    = 1
	MaxMonthInYear = 12
	MinMonthInYear = 1
)
View Source
const (
	DateType      = 0
	DateTimeType  = 1
	TimeStampType = 2
)
View Source
const (
	Start = iota
	YearState
	MonthState
	DayState
	HourState
	MinuteState
	SecondState
	MsState
	End
)
View Source
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
)
View Source
const (
	NanoSecsPerSec = 1000000000 // 10^9

	MillisecsPerSec = 1000 // 10^3

	MaxDatetimeYear = 9999
	MinDatetimeYear = 1
)
View Source
const (
	// Max string buf + 1 (\0) needed by decimal64
	DECIMAL64_ZSTR_LEN = 25
	DECIMAL64_WIDTH    = 16
	DECIMAL64_NBYTES   = 8
	// Max string buf + 1 (\0) needed by decimal128
	DECIMAL128_ZSTR_LEN = 43
	DECIMAL128_WIDTH    = 34
	DECIMAL128_NBYTES   = 16
	MYSQL_DEFAULT_SCALE = 4
)
View Source
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
)
View Source
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
)
View Source
const (
	TxnTsSize = 12
	RowidSize = 16
)
View Source
const IntervalNumMAX = int64(^uint64(0) >> 21)
View Source
const PackerMemUnit = 64

Variables

View Source
var Decimal128Max = Decimal128_Inf()
View Source
var Decimal128Min = Decimal128_NegInf()
View Source
var Decimal64Max = Decimal64_Inf()
View Source
var Decimal64Min = Decimal64_NegInf()
View Source
var (
	FillString = []string{"", "0", "00", "000", "0000", "00000", "000000", "0000000"}
)
View Source
var OneSecInMicroSeconds = uint32(1000000)
View Source
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,

	"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,

	"json": T_json,
	"text": T_text,
	"blob": T_blob,
	"uuid": T_uuid,

	"transaction timestamp": T_TS,
	"rowid":                 T_Rowid,
}

Functions

func AppendBoolToByteArray added in v0.5.0

func AppendBoolToByteArray(b bool, arr []byte) []byte

func BoolToIntString added in v0.6.0

func BoolToIntString(b bool) string

ToIntString print out 1 or 0 as true/false.

func CharsetType added in v0.6.0

func CharsetType(oid T) uint8

func CompareDecimal128 added in v0.6.0

func CompareDecimal128(a, b Decimal128) int

func CompareDecimal128Decimal128

func CompareDecimal128Decimal128(a, b Decimal128, s1, s2 int32) int64

func CompareDecimal128Decimal128Aligned

func CompareDecimal128Decimal128Aligned(a, b Decimal128) int64

func CompareDecimal64 added in v0.6.0

func CompareDecimal64(a, b Decimal64) int

Comapres

func CompareDecimal64Decimal64

func CompareDecimal64Decimal64(a, b Decimal64, s1, s2 int32) int64

func CompareDecimal64Decimal64Aligned

func CompareDecimal64Decimal64Aligned(a, b Decimal64) int64

func CompareRowidRowidAligned added in v0.6.0

func CompareRowidRowidAligned(a, b Rowid) int64

func CompareTSTSAligned added in v0.6.0

func CompareTSTSAligned(a, b TS) int64

func CompareUuid added in v0.6.0

func CompareUuid(left Uuid, right Uuid) int64

func Decimal128IsZero

func Decimal128IsZero(d Decimal128) bool

func Decimal128ToInt64Raw added in v0.6.0

func Decimal128ToInt64Raw(d Decimal128) (int64, int64)

func Decimal64IsZero added in v0.6.0

func Decimal64IsZero(d Decimal64) bool

func Decimal64ToInt64Raw added in v0.6.0

func Decimal64ToInt64Raw(d Decimal64) int64

func Decode added in v0.6.0

func Decode(data []byte, v interface{}) error

func DecodeBool added in v0.6.0

func DecodeBool(v []byte) bool

func DecodeFixed added in v0.6.0

func DecodeFixed[T FixedSizeT](v []byte) T

func DecodeFloat32 added in v0.6.0

func DecodeFloat32(v []byte) float32

func DecodeFloat64 added in v0.6.0

func DecodeFloat64(v []byte) float64

func DecodeInt16 added in v0.6.0

func DecodeInt16(v []byte) int16

func DecodeInt32 added in v0.6.0

func DecodeInt32(v []byte) int32

func DecodeInt64 added in v0.6.0

func DecodeInt64(v []byte) int64

func DecodeInt8 added in v0.6.0

func DecodeInt8(v []byte) int8

func DecodeJson added in v0.6.0

func DecodeJson(buf []byte) bytejson.ByteJson

func DecodeSlice added in v0.6.0

func DecodeSlice[T any](v []byte) []T

func DecodeStringSlice added in v0.6.0

func DecodeStringSlice(data []byte) []string

func DecodeUint16 added in v0.6.0

func DecodeUint16(v []byte) uint16

func DecodeUint32 added in v0.6.0

func DecodeUint32(v []byte) uint32

func DecodeUint64 added in v0.6.0

func DecodeUint64(v []byte) uint64

func DecodeUint8 added in v0.6.0

func DecodeUint8(v []byte) uint8

func DecodeValue added in v0.6.0

func DecodeValue(val []byte, typ Type) any

func DefaultVal added in v0.6.0

func DefaultVal[T any]() T

Why don't we just do var v T

func Encode added in v0.6.0

func Encode(v interface{}) ([]byte, error)

func EncodeBool added in v0.6.0

func EncodeBool(v *bool) []byte

func EncodeDate added in v0.6.0

func EncodeDate(v *Date) []byte

func EncodeDatetime added in v0.6.0

func EncodeDatetime(v *Datetime) []byte

func EncodeDecimal128 added in v0.6.0

func EncodeDecimal128(v *Decimal128) []byte

func EncodeDecimal64 added in v0.6.0

func EncodeDecimal64(v *Decimal64) []byte

func EncodeFixed added in v0.6.0

func EncodeFixed[T FixedSizeT](v T) []byte

func EncodeFloat32 added in v0.6.0

func EncodeFloat32(v *float32) []byte

func EncodeFloat64 added in v0.6.0

func EncodeFloat64(v *float64) []byte

func EncodeInt16 added in v0.6.0

func EncodeInt16(v *int16) []byte

func EncodeInt32 added in v0.6.0

func EncodeInt32(v *int32) []byte

func EncodeInt64 added in v0.6.0

func EncodeInt64(v *int64) []byte

func EncodeInt8 added in v0.6.0

func EncodeInt8(v *int8) []byte

func EncodeJson added in v0.6.0

func EncodeJson(v bytejson.ByteJson) ([]byte, error)

func EncodeSlice added in v0.6.0

func EncodeSlice[T any](v []T) []byte

func EncodeSliceWithCap added in v0.6.0

func EncodeSliceWithCap[T any](v []T) []byte

func EncodeStringSlice added in v0.6.0

func EncodeStringSlice(vs []string) []byte

func EncodeTime added in v0.6.0

func EncodeTime(v *Time) []byte

func EncodeTimestamp added in v0.6.0

func EncodeTimestamp(v *Timestamp) []byte

func EncodeType added in v0.6.0

func EncodeType(v *Type) []byte

func EncodeUint16 added in v0.6.0

func EncodeUint16(v *uint16) []byte

func EncodeUint32 added in v0.6.0

func EncodeUint32(v *uint32) []byte

func EncodeUint64 added in v0.6.0

func EncodeUint64(v *uint64) []byte

func EncodeUint8 added in v0.6.0

func EncodeUint8(v *uint8) []byte

func EncodeUuid added in v0.6.0

func EncodeUuid(v *Uuid) []byte

func EncodeValue added in v0.6.0

func EncodeValue(val any, typ Type) []byte

func EqualUuid added in v0.6.0

func EqualUuid(src Uuid, dest Uuid) bool

func GetUnixEpochSecs added in v0.7.0

func GetUnixEpochSecs() int64

func Hash added in v0.6.0

func Hash(v any, typ Type) (uint64, error)

TAE's own hash ... Sigh.

func IsAllNumber added in v0.7.0

func IsAllNumber(s *string) bool

func IsDateRelate added in v0.6.0

func IsDateRelate(t T) bool

func IsDecimal added in v0.6.0

func IsDecimal(t T) bool

IsDecimal: return true if the types.T is decimal64 or decimal128

func IsFloat added in v0.6.0

func IsFloat(t T) bool

IsFloat: return true if the types.T is floating Point Types

func IsInteger added in v0.6.0

func IsInteger(t T) bool

if expr type is integer return true,else return false

func IsNull added in v0.6.0

func IsNull(v any) bool

func IsNumber added in v0.7.0

func IsNumber(s *string, idx int) bool

func IsSignedInt added in v0.6.0

func IsSignedInt(t T) bool

isSignedInt: return true if the types.T is Signed integer type

func IsString added in v0.6.0

func IsString(t T) bool

isString: return true if the types.T is string type

func IsUnsignedInt added in v0.6.0

func IsUnsignedInt(t T) bool

isUnsignedInt: return true if the types.T is UnSigned integer type

func JudgeIntervalNumOverflow added in v0.5.0

func JudgeIntervalNumOverflow(num int64, it IntervalType) error

func LastDay added in v0.5.0

func LastDay(year int32, month uint8) uint8

func NewPacker added in v0.6.0

func NewPacker(mp *mpool.MPool) *packer

func NewPackerArray added in v0.6.0

func NewPackerArray(length int, mp *mpool.MPool) []*packer

func NewProtoType added in v0.6.0

func NewProtoType(oid T) *plan.Type

func ParseBool added in v0.5.0

func ParseBool(s string) (bool, error)

func ParseSliceToByteJson added in v0.6.0

func ParseSliceToByteJson(dt []byte) (bytejson.ByteJson, error)

func ParseStringToByteJson added in v0.6.0

func ParseStringToByteJson(str string) (bytejson.ByteJson, error)

func ParseStringToPath added in v0.6.0

func ParseStringToPath(str string) (bytejson.Path, error)

func ParseValueToBool added in v0.5.0

func ParseValueToBool(num *tree.NumVal) (bool, error)

func ToNumber added in v0.7.0

func ToNumber(s string) int64

func TypeSize added in v0.5.0

func TypeSize(oid T) int

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 UuidToString(muuid Uuid) (string, error)

func ValidDate added in v0.6.0

func ValidDate(year int32, month, day uint8) bool

date[0001-01-01 to 9999-12-31]

func ValidDatetime added in v0.6.0

func ValidDatetime(year int32, month, day uint8) bool

date[0001-01-01 00:00:00 to 9999-12-31 23:59:59]

func ValidTime added in v0.6.0

func ValidTime(h, m, s uint64) bool

func ValidTimeInDay added in v0.6.0

func ValidTimeInDay(h, m, s uint8) bool

validTimeInDay return true if hour, minute and second can be a time during a day

func ValidTimestamp added in v0.5.0

func ValidTimestamp(timestamp Timestamp) bool

func WriteValues added in v0.6.0

func WriteValues(w io.Writer, vals ...any) (n int64, err error)

Types

type BuiltinNumber added in v0.6.0

type BuiltinNumber interface {
	Ints | UInts | Floats
}

type Date

type Date int32

func DateFromCalendar added in v0.7.0

func DateFromCalendar(year int32, month, day uint8) Date

func DecodeDate added in v0.6.0

func DecodeDate(v []byte) Date

func ParseDateCast added in v0.5.0

func ParseDateCast(s string) (Date, error)

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 Today

func Today(loc *time.Location) Date

Today Holds number of days since January 1, year 1 in Gregorian calendar

func (Date) Calendar

func (d Date) Calendar(full bool) (year int32, month, day uint8, yday uint16)

func (Date) Day added in v0.5.0

func (d Date) Day() uint8

func (Date) DayOfWeek

func (d Date) DayOfWeek() Weekday

DayOfWeek return the day of the week of the date

func (Date) DayOfYear

func (d Date) DayOfYear() uint16

DayOfYear return day of year (001..366)

func (Date) DaysSinceUnixEpoch added in v0.7.0

func (d Date) DaysSinceUnixEpoch() int32

func (Date) Month

func (d Date) Month() uint8

func (Date) Quarter added in v0.5.0

func (d Date) Quarter() uint32

func (Date) String

func (d Date) String() string

func (Date) ToDatetime added in v0.6.0

func (d Date) ToDatetime() Datetime

func (Date) ToTime

func (d Date) ToTime() Time

func (Date) ToTimestamp added in v0.6.0

func (d Date) ToTimestamp(loc *time.Location) Timestamp

func (Date) Week added in v0.6.0

func (d Date) Week(mode int) int

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 (d Date) WeekOfYear() (year int32, week uint8)

func (Date) WeekOfYear2 added in v0.5.0

func (d Date) WeekOfYear2() uint8

func (Date) Year

func (d Date) Year() uint16

Year takes a date and returns an uint16 number as the year of this date

func (Date) YearMonth added in v0.5.0

func (d Date) YearMonth() uint32

func (Date) YearMonthStr added in v0.5.0

func (d Date) YearMonthStr() string

func (Date) YearWeek added in v0.6.0

func (d Date) YearWeek(mode int) (year int, week int)

YearWeek returns year and week.

type Datetime

type Datetime int64

func DatetimeFromClock added in v0.7.0

func DatetimeFromClock(year int32, month, day, hour, minute, sec uint8, msec uint32) Datetime

func DatetimeFromUnix added in v0.7.0

func DatetimeFromUnix(loc *time.Location, ts int64) Datetime

func DatetimeFromUnixWithNsec added in v0.7.0

func DatetimeFromUnixWithNsec(loc *time.Location, sec int64, nsec int64) Datetime

func DecodeDatetime added in v0.6.0

func DecodeDatetime(v []byte) Datetime

func Now

func Now(loc *time.Location) Datetime

func ParseDatetime

func ParseDatetime(s string, precision int32) (Datetime, error)

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 precision, 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 TimestampToDatetime(loc *time.Location, xs []Timestamp, rs []Datetime) ([]Datetime, error)

func UTC added in v0.6.0

func UTC() Datetime

func (Datetime) AddDateTime added in v0.5.0

func (dt Datetime) AddDateTime(addMonth, addYear int64, timeType TimeType) (Datetime, bool)

func (Datetime) AddInterval added in v0.5.0

func (dt Datetime) AddInterval(nums int64, its IntervalType, timeType TimeType) (Datetime, bool)

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) Clock

func (dt Datetime) Clock() (hour, minute, sec int8)

func (Datetime) ConvertToGoTime added in v0.5.0

func (dt Datetime) ConvertToGoTime(loc *time.Location) time.Time

func (Datetime) ConvertToMonth added in v0.6.0

func (dt Datetime) ConvertToMonth(secondDt Datetime) int64

func (Datetime) DateTimeDiffWithUnit added in v0.6.0

func (dt Datetime) DateTimeDiffWithUnit(its string, secondDt Datetime) (int64, error)

func (Datetime) DatetimeMinusWithSecond added in v0.6.0

func (dt Datetime) DatetimeMinusWithSecond(secondDt Datetime) int64

func (Datetime) Day added in v0.5.0

func (dt Datetime) Day() uint8

func (Datetime) DayHourStr added in v0.5.0

func (dt Datetime) DayHourStr() string

func (Datetime) DayMicrosecondStr added in v0.5.0

func (dt Datetime) DayMicrosecondStr() string

func (Datetime) DayMinuteStr added in v0.5.0

func (dt Datetime) DayMinuteStr() string

func (Datetime) DayOfWeek added in v0.6.0

func (dt Datetime) DayOfWeek() Weekday

func (Datetime) DayOfYear added in v0.6.0

func (dt Datetime) DayOfYear() uint16

func (Datetime) DaySecondStr added in v0.5.0

func (dt Datetime) DaySecondStr() string

func (Datetime) Hour added in v0.5.0

func (dt Datetime) Hour() int8

func (Datetime) HourMicrosecondStr added in v0.5.0

func (dt Datetime) HourMicrosecondStr() string

func (Datetime) HourMinuteStr added in v0.5.0

func (dt Datetime) HourMinuteStr() string

func (Datetime) HourSecondStr added in v0.5.0

func (dt Datetime) HourSecondStr() string

func (Datetime) MicroSec added in v0.5.0

func (dt Datetime) MicroSec() int64

func (Datetime) Minute added in v0.5.0

func (dt Datetime) Minute() int8

func (Datetime) MinuteMicrosecondStr added in v0.5.0

func (dt Datetime) MinuteMicrosecondStr() string

func (Datetime) MinuteSecondStr added in v0.5.0

func (dt Datetime) MinuteSecondStr() string

func (Datetime) Month

func (dt Datetime) Month() uint8

func (Datetime) Sec added in v0.5.0

func (dt Datetime) Sec() int8

func (Datetime) SecondMicrosecondStr added in v0.5.0

func (dt Datetime) SecondMicrosecondStr() string

func (Datetime) SecsSinceUnixEpoch added in v0.7.0

func (dt Datetime) SecsSinceUnixEpoch() int64

func (Datetime) String

func (dt Datetime) String() string

func (Datetime) String2 added in v0.5.0

func (dt Datetime) String2(precision int32) string

func (Datetime) ToDate

func (dt Datetime) ToDate() Date

func (Datetime) ToTime added in v0.6.0

func (dt Datetime) ToTime(precision int32) Time

We need to truncate the part after precision position when cast between different precision.

func (Datetime) ToTimestamp added in v0.6.0

func (dt Datetime) ToTimestamp(loc *time.Location) Timestamp

func (Datetime) UnixTimestamp added in v0.5.0

func (dt Datetime) UnixTimestamp(loc *time.Location) int64

func (Datetime) Week added in v0.6.0

func (dt Datetime) Week(mode int) int

func (Datetime) WeekOfYear added in v0.5.0

func (dt Datetime) WeekOfYear() (int32, uint8)

func (Datetime) Year

func (dt Datetime) Year() uint16

func (Datetime) YearMonthStr added in v0.5.0

func (dt Datetime) YearMonthStr() string

func (Datetime) YearWeek added in v0.6.0

func (dt Datetime) YearWeek(mode int) (year int, week int)

YearWeek returns year and week.

type Decimal added in v0.5.0

type Decimal interface {
	Decimal64 | Decimal128
}

type Decimal128

type Decimal128 [16]byte
var Decimal128_One Decimal128 = Decimal128FromInt32(1)
var Decimal128_Ten Decimal128 = Decimal128FromInt32(10)
var Decimal128_Three Decimal128 = Decimal128FromInt32(3)
var Decimal128_Two Decimal128 = Decimal128FromInt32(2)
var Decimal128_Zero Decimal128 = Decimal128FromInt32(0)

func AlignDecimal128UsingScaleDiffBatch added in v0.5.0

func AlignDecimal128UsingScaleDiffBatch(src, dst []Decimal128, _ int32) []Decimal128

func Decimal128Add

func Decimal128Add(a, b Decimal128, s1, s2 int32) Decimal128

func Decimal128AddAligned

func Decimal128AddAligned(a, b Decimal128) Decimal128

func Decimal128Decimal128Div

func Decimal128Decimal128Div(a, b Decimal128) Decimal128

func Decimal128Decimal128Mul

func Decimal128Decimal128Mul(a, b Decimal128) Decimal128

func Decimal128FromFloat64 added in v0.6.0

func Decimal128FromFloat64(f float64, width, scale int32) (Decimal128, error)

func Decimal128FromInt32 added in v0.6.0

func Decimal128FromInt32(i int32) Decimal128

func Decimal128FromInt64Raw added in v0.6.0

func Decimal128FromInt64Raw(a, b int64) Decimal128

func Decimal128Int64Div added in v0.5.0

func Decimal128Int64Div(a Decimal128, b int64) Decimal128

func Decimal128Int64Mul added in v0.5.0

func Decimal128Int64Mul(a Decimal128, b int64) Decimal128

func Decimal128Sub

func Decimal128Sub(a, b Decimal128, s1, s2 int32) Decimal128

func Decimal128SubAligned

func Decimal128SubAligned(a, b Decimal128) Decimal128

func Decimal128_FromDecimal64 added in v0.6.0

func Decimal128_FromDecimal64(d64 Decimal64) Decimal128

func Decimal128_FromDecimal64WithScale added in v0.6.0

func Decimal128_FromDecimal64WithScale(d64 Decimal64, width, scale int32) (Decimal128, error)

func Decimal128_FromFloat64 added in v0.6.0

func Decimal128_FromFloat64(f float64, width, scale int32) (Decimal128, error)

func Decimal128_FromInt32 added in v0.6.0

func Decimal128_FromInt32(i int32) Decimal128

Conversions, from go type to decimal128

func Decimal128_FromInt64 added in v0.6.0

func Decimal128_FromInt64(i int64, width, scale int32) (Decimal128, error)

func Decimal128_FromString added in v0.6.0

func Decimal128_FromString(s string) (Decimal128, error)

func Decimal128_FromStringWithScale added in v0.6.0

func Decimal128_FromStringWithScale(s string, width, scale int32) (Decimal128, error)

func Decimal128_FromUint32 added in v0.6.0

func Decimal128_FromUint32(i uint32) Decimal128

func Decimal128_FromUint64 added in v0.6.0

func Decimal128_FromUint64(i uint64, width, scale int32) (Decimal128, error)

func Decimal128_Inf added in v0.6.0

func Decimal128_Inf() Decimal128

func Decimal128_NaN added in v0.6.0

func Decimal128_NaN() Decimal128

func Decimal128_NegInf added in v0.6.0

func Decimal128_NegInf() Decimal128

func Decimal64Decimal64Div

func Decimal64Decimal64Div(a, b Decimal64) Decimal128

func Decimal64Decimal64Mul

func Decimal64Decimal64Mul(a, b Decimal64) Decimal128

func DecodeDecimal128 added in v0.6.0

func DecodeDecimal128(v []byte) Decimal128

func InitDecimal128

func InitDecimal128(i int64, width, scale int32) (Decimal128, error)

func InitDecimal128UsingUint added in v0.5.0

func InitDecimal128UsingUint(i uint64, width, scale int32) (Decimal128, error)

func MustDecimal128FromString added in v0.6.0

func MustDecimal128FromString(s string) Decimal128

func NegDecimal128

func NegDecimal128(d Decimal128) Decimal128

func ParseStringToDecimal128

func ParseStringToDecimal128(s string, width int32, scale int32, isBin bool) (Decimal128, error)

func ParseStringToDecimal128WithoutTable

func ParseStringToDecimal128WithoutTable(s string, isBin ...bool) (Decimal128, int32, error)

func (Decimal128) Add added in v0.6.0

func (d Decimal128) Add(x Decimal128) Decimal128

func (Decimal128) AddDecimal64 added in v0.6.0

func (d Decimal128) AddDecimal64(d64 Decimal64) Decimal128

func (Decimal128) AddInt64 added in v0.6.0

func (d Decimal128) AddInt64(i int64) Decimal128

func (Decimal128) Compare added in v0.6.0

func (d Decimal128) Compare(other Decimal128) int

func (Decimal128) Div added in v0.6.0

func (d Decimal128) Div(x Decimal128) Decimal128

func (Decimal128) DivInt64 added in v0.6.0

func (d Decimal128) DivInt64(x int64) Decimal128

func (Decimal128) Eq added in v0.6.0

func (d Decimal128) Eq(other Decimal128) bool

func (Decimal128) Ge added in v0.6.0

func (d Decimal128) Ge(other Decimal128) bool

func (Decimal128) Gt added in v0.6.0

func (d Decimal128) Gt(other Decimal128) bool

func (Decimal128) Le added in v0.6.0

func (d Decimal128) Le(other Decimal128) bool

func (Decimal128) Lt added in v0.6.0

func (d Decimal128) Lt(other Decimal128) bool

func (Decimal128) Mul added in v0.6.0

func (d Decimal128) Mul(x Decimal128) Decimal128

func (Decimal128) MulInt64 added in v0.6.0

func (d Decimal128) MulInt64(x int64) Decimal128

func (Decimal128) Ne added in v0.6.0

func (d Decimal128) Ne(other Decimal128) bool

func (Decimal128) String added in v0.6.0

func (d Decimal128) String() string

func (Decimal128) Sub added in v0.6.0

func (d Decimal128) Sub(x Decimal128) Decimal128

func (Decimal128) SubInt64 added in v0.6.0

func (d Decimal128) SubInt64(i int64) Decimal128

func (Decimal128) ToDecimal64 added in v0.6.0

func (d Decimal128) ToDecimal64(width, scale int32) (Decimal64, error)

func (Decimal128) ToFloat64 added in v0.6.0

func (d Decimal128) ToFloat64() float64

func (Decimal128) ToInt64 added in v0.6.0

func (d Decimal128) ToInt64() int64

func (Decimal128) ToString added in v0.6.0

func (d Decimal128) ToString() string

func (Decimal128) ToStringWithScale added in v0.6.0

func (d Decimal128) ToStringWithScale(scale int32) string

type Decimal64

type Decimal64 [8]byte
var Decimal64_One Decimal64 = Decimal64FromInt32(1)
var Decimal64_Ten Decimal64 = Decimal64FromInt32(10)
var Decimal64_Three Decimal64 = Decimal64FromInt32(3)
var Decimal64_Two Decimal64 = Decimal64FromInt32(2)
var Decimal64_Zero Decimal64 = Decimal64FromInt32(0)

func AlignDecimal64UsingScaleDiffBatch added in v0.5.0

func AlignDecimal64UsingScaleDiffBatch(src, dst []Decimal64, _ int32) []Decimal64

func Decimal64Add

func Decimal64Add(a, b Decimal64, s1, s2 int32) Decimal64

func Decimal64AddAligned

func Decimal64AddAligned(a, b Decimal64) Decimal64

func Decimal64FromFloat64 added in v0.6.0

func Decimal64FromFloat64(f float64, width, scale int32) (Decimal64, error)

func Decimal64FromInt32 added in v0.6.0

func Decimal64FromInt32(i int32) Decimal64

func Decimal64FromInt64Raw added in v0.6.0

func Decimal64FromInt64Raw(a int64) Decimal64

func Decimal64Int64Mul added in v0.5.0

func Decimal64Int64Mul(a Decimal64, b int64) Decimal64

func Decimal64Sub

func Decimal64Sub(a, b Decimal64, s1, s2 int32) Decimal64

func Decimal64SubAligned

func Decimal64SubAligned(a, b Decimal64) Decimal64

func Decimal64_FromFloat64 added in v0.6.0

func Decimal64_FromFloat64(f float64, width int32, scale int32) (Decimal64, error)

func Decimal64_FromInt32 added in v0.6.0

func Decimal64_FromInt32(i int32) Decimal64

Conversions, from go type to decimal64

func Decimal64_FromInt64 added in v0.6.0

func Decimal64_FromInt64(i int64, width, scale int32) (Decimal64, error)

func Decimal64_FromString added in v0.6.0

func Decimal64_FromString(s string) (Decimal64, error)

func Decimal64_FromStringWithScale added in v0.6.0

func Decimal64_FromStringWithScale(s string, width, scale int32) (Decimal64, error)

func Decimal64_FromUint32 added in v0.6.0

func Decimal64_FromUint32(i uint32) Decimal64

func Decimal64_FromUint64 added in v0.6.0

func Decimal64_FromUint64(i uint64, width, scale int32) (Decimal64, error)

func Decimal64_Inf added in v0.6.0

func Decimal64_Inf() Decimal64

func Decimal64_NaN added in v0.6.0

func Decimal64_NaN() Decimal64

func Decimal64_NegInf added in v0.6.0

func Decimal64_NegInf() Decimal64

func DecodeDecimal64 added in v0.6.0

func DecodeDecimal64(v []byte) Decimal64

func InitDecimal64 added in v0.5.0

func InitDecimal64(i int64, width, scale int32) (Decimal64, error)

func InitDecimal64UsingUint added in v0.6.0

func InitDecimal64UsingUint(i uint64, width, scale int32) (Decimal64, error)

func MustDecimal64FromString added in v0.6.0

func MustDecimal64FromString(s string) Decimal64

func ParseStringToDecimal64

func ParseStringToDecimal64(s string, width int32, scale int32, isBin bool) (Decimal64, error)

Wrap old decimal api. Most likely we should delete them.

func ParseStringToDecimal64WithoutTable added in v0.6.0

func ParseStringToDecimal64WithoutTable(s string, isBin ...bool) (Decimal64, int32, error)

func (Decimal64) Add added in v0.6.0

func (d Decimal64) Add(x Decimal64) Decimal64

Arithmatics

func (Decimal64) AddInt64 added in v0.6.0

func (d Decimal64) AddInt64(i int64) Decimal64

func (Decimal64) Compare added in v0.6.0

func (d Decimal64) Compare(other Decimal64) int

func (Decimal64) Div added in v0.6.0

func (d Decimal64) Div(x Decimal64) Decimal64

func (Decimal64) DivInt64 added in v0.6.0

func (d Decimal64) DivInt64(x int64) Decimal64

func (Decimal64) DivWiden added in v0.6.0

func (d Decimal64) DivWiden(x Decimal64) Decimal128

func (Decimal64) Eq added in v0.6.0

func (d Decimal64) Eq(other Decimal64) bool

func (Decimal64) Ge added in v0.6.0

func (d Decimal64) Ge(other Decimal64) bool

func (Decimal64) Gt added in v0.6.0

func (d Decimal64) Gt(other Decimal64) bool

func (Decimal64) Le added in v0.6.0

func (d Decimal64) Le(other Decimal64) bool

func (Decimal64) Lt added in v0.6.0

func (d Decimal64) Lt(other Decimal64) bool

func (Decimal64) Mul added in v0.6.0

func (d Decimal64) Mul(x Decimal64) Decimal64

func (Decimal64) MulInt64 added in v0.6.0

func (d Decimal64) MulInt64(x int64) Decimal64

func (Decimal64) MulWiden added in v0.6.0

func (d Decimal64) MulWiden(x Decimal64) Decimal128

func (Decimal64) Ne added in v0.6.0

func (d Decimal64) Ne(other Decimal64) bool

func (Decimal64) String added in v0.6.0

func (d Decimal64) String() string

func (Decimal64) Sub added in v0.6.0

func (d Decimal64) Sub(x Decimal64) Decimal64

func (Decimal64) SubInt64 added in v0.6.0

func (d Decimal64) SubInt64(i int64) Decimal64

func (Decimal64) ToFloat64 added in v0.6.0

func (d Decimal64) ToFloat64() float64

Conversions. decimal to go types.

func (Decimal64) ToInt64 added in v0.6.0

func (d Decimal64) ToInt64() int64

func (Decimal64) ToString added in v0.6.0

func (d Decimal64) ToString() string

func (Decimal64) ToStringWithScale added in v0.6.0

func (d Decimal64) ToStringWithScale(scale int32) string

type FixedBytes added in v0.6.0

type FixedBytes interface {
	TS | Rowid
}

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 {
	bool | OrderedT | Decimal | TS | Rowid | Varlena | Uuid
}

FixedSized types in our type system. Esp, Varlena.

type Floats added in v0.5.0

type Floats interface {
	float32 | float64
}

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 Ints added in v0.5.0

type Ints interface {
	int8 | int16 | int32 | int64
}

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 (*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 Null added in v0.6.0

type Null struct{}

Very opinioned code, almost surely a bug, but there you go.

type Number added in v0.5.0

type Number interface {
	Ints | UInts | Floats | Decimal
}

type OrderedT added in v0.6.0

type OrderedT interface {
	constraints.Ordered | Date | Time | Datetime | Timestamp
}

type Rowid added in v0.6.0

type Rowid [RowidSize]byte

Rowid

func BuildRowid added in v0.6.0

func BuildRowid(a, b int64) (ret Rowid)

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

	// 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

	// blobs
	T_blob T = 70
	T_text T = 71

	// Transaction TS
	T_TS    T = 100
	T_Rowid T = 101

	// system family
	T_tuple T = 201
)

func (T) FixedLength

func (t T) FixedLength() int

FixedLength dangerous code, use TypeLen() if you don't want -8, -16, -24

func (T) OidString

func (t T) OidString() string

OidString returns T string

func (T) String

func (t T) String() string

func (T) ToType

func (t T) ToType() Type

func (T) TypeLen

func (t T) TypeLen() int

TypeLen returns type's length whose type oid is T

type TS added in v0.6.0

type TS [TxnTsSize]byte

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 BuildTS added in v0.6.0

func BuildTS(p int64, l uint32) (ret TS)

func MaxTs added in v0.6.0

func MaxTs() TS

func NextGlobalTsForTest added in v0.6.0

func NextGlobalTsForTest() TS

func StringToTS added in v0.6.0

func StringToTS(s string) (ts TS)

func TimestampToTS added in v0.6.0

func TimestampToTS(ts timestamp.Timestamp) TS

TODO::need to take "NodeID" account into

func (TS) Compare added in v0.6.0

func (ts TS) Compare(rhs TS) int

Compare physical first then logical.

func (TS) Equal added in v0.6.0

func (ts TS) Equal(rhs TS) bool

func (TS) Greater added in v0.6.0

func (ts TS) Greater(rhs TS) bool

func (TS) GreaterEq added in v0.6.0

func (ts TS) GreaterEq(rhs TS) bool

func (TS) IsEmpty added in v0.6.0

func (ts TS) IsEmpty() bool

func (TS) Less added in v0.6.0

func (ts TS) Less(rhs TS) bool

func (TS) LessEq added in v0.6.0

func (ts TS) LessEq(rhs TS) bool

func (TS) Logical added in v0.6.0

func (ts TS) Logical() uint32

func (TS) Next added in v0.6.0

func (ts TS) Next() TS

func (TS) Physical added in v0.6.0

func (ts TS) Physical() int64

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) Prev added in v0.6.0

func (ts TS) Prev() TS

Who use this function?

func (TS) ToString added in v0.6.0

func (ts TS) ToString() string

func (TS) ToTimestamp added in v0.6.0

func (ts TS) ToTimestamp() timestamp.Timestamp

type Time added in v0.6.0

type Time int64

func DecodeTime added in v0.6.0

func DecodeTime(v []byte) Time

func ParseDecimal128lToTime added in v0.7.0

func ParseDecimal128lToTime(input Decimal128, precision int32) (Time, error)

func ParseDecimal64lToTime added in v0.7.0

func ParseDecimal64lToTime(input Decimal64, precision int32) (Time, error)

func ParseInt64ToTime added in v0.6.0

func ParseInt64ToTime(input int64, precision int32) (Time, error)

func ParseTime added in v0.6.0

func ParseTime(s string, precision int32) (Time, error)

During parsing, if the input length of msec is larger than predefined precision, 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 TimeFromClock(isNegative bool, hour uint64, minute, sec uint8, msec uint32) Time

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

func (t Time) ClockFormat() (hour uint64, minute, sec uint8, msec uint64, isNeg bool)

ClockFormat: symbol part/hour part/minute part/second part/msecond part

func (Time) ConvertToInterval added in v0.6.0

func (t Time) ConvertToInterval(ctx context.Context, its string) (int64, error)

func (Time) Hour added in v0.6.0

func (t Time) Hour() int64

func (Time) MicroSec added in v0.6.0

func (t Time) MicroSec() int64

func (Time) Minute added in v0.6.0

func (t Time) Minute() int8

func (Time) NumericString added in v0.6.0

func (t Time) NumericString(precision int32) string

Format: hhmmss.msec TODO: add the carry when truncate

func (Time) Sec added in v0.6.0

func (t Time) Sec() int8

func (Time) String added in v0.6.0

func (t Time) String() string

no msec part Format: hh:mm:ss

func (Time) String2 added in v0.6.0

func (t Time) String2(precision int32) string

Format: hh:mm:ss.msec

func (Time) ToDate added in v0.6.0

func (t Time) ToDate() Date

TODO: Get Today date from local time zone setting?

func (Time) ToDatetime added in v0.6.0

func (t Time) ToDatetime(precision int32) Datetime

We need to truncate the part after precision position when cast between different precision.

func (Time) ToDecimal128 added in v0.6.0

func (t Time) ToDecimal128(ctx context.Context, width, precision int32) (Decimal128, error)

func (Time) ToDecimal64 added in v0.6.0

func (t Time) ToDecimal64(ctx context.Context, width, precision int32) (Decimal64, error)

func (Time) ToInt64 added in v0.6.0

func (t Time) ToInt64() int64

type TimeType added in v0.5.0

type TimeType int32

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 DecodeTimestamp(v []byte) Timestamp

func FromClockUTC added in v0.5.0

func FromClockUTC(year int32, month, day, hour, minute, sec uint8, msec uint32) Timestamp

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

func ParseTimestamp(loc *time.Location, s string, precision int32) (Timestamp, error)

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 UnixMicroToTimestamp(ts int64) Timestamp

func UnixNanoToTimestamp added in v0.7.0

func UnixNanoToTimestamp(ts int64) Timestamp

func UnixToTimestamp added in v0.5.0

func UnixToTimestamp(ts int64) Timestamp

func (Timestamp) String added in v0.5.0

func (ts Timestamp) String() string

func (Timestamp) String2 added in v0.5.0

func (ts Timestamp) String2(loc *time.Location, precision int32) string

String2 stringify timestamp, including its fractional seconds precision part(fsp)

func (Timestamp) Unix added in v0.6.0

func (ts Timestamp) Unix() int64

func (Timestamp) UnixToDecimal128 added in v0.6.0

func (ts Timestamp) UnixToDecimal128() (Decimal128, error)

func (Timestamp) UnixToFloat added in v0.6.0

func (ts Timestamp) UnixToFloat() float64

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) Get added in v0.6.0

func (alloc *TsAlloctor) Get() TS

TODO::will be removed

func (*TsAlloctor) SetStart added in v0.6.0

func (alloc *TsAlloctor) SetStart(start TS)

type Tuple added in v0.6.0

type Tuple []TupleElement

func Unpack added in v0.6.0

func Unpack(b []byte) (Tuple, error)

func (Tuple) String added in v0.6.0

func (t Tuple) String() string

type TupleElement added in v0.6.0

type TupleElement interface{}

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

	// Width means max Display width for float and double, char and varchar
	// todo: need to add new attribute DisplayWidth ?
	Size      int32
	Width     int32
	Scale     int32
	Precision int32
	// contains filtered or unexported fields
}
var CompoundKeyType Type

CompoundKeyType -- this is simply deadly wrong thing.

func DecodeType added in v0.6.0

func DecodeType(v []byte) Type

func MockColTypes added in v0.6.0

func MockColTypes(colCnt int) (ct []Type)

func New added in v0.5.0

func New(oid T, width, scale, precision int32) Type

func (Type) DescString added in v0.7.0

func (t Type) DescString() string

func (Type) Eq

func (t Type) Eq(b Type) bool

func (Type) IsBoolean added in v0.6.0

func (t Type) IsBoolean() bool

func (Type) IsFixedLen added in v0.6.0

func (t Type) IsFixedLen() bool

func (Type) IsFloat added in v0.6.0

func (t Type) IsFloat() bool

func (Type) IsInt added in v0.6.0

func (t Type) IsInt() bool

func (Type) IsIntOrUint added in v0.6.0

func (t Type) IsIntOrUint() bool

func (Type) IsString added in v0.5.1

func (t Type) IsString() bool

Bad function, but keep for now so that old code works.

func (Type) IsTuple added in v0.6.0

func (t Type) IsTuple() bool

Special

func (Type) IsUInt added in v0.6.0

func (t Type) IsUInt() bool

func (Type) IsVarlen added in v0.6.0

func (t Type) IsVarlen() bool

func (Type) String

func (t Type) String() string

func (Type) TypeSize added in v0.5.1

func (t Type) TypeSize() int

type UInts added in v0.5.0

type UInts interface {
	uint8 | uint16 | uint32 | uint64
}

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 BuildUuid added in v0.6.0

func BuildUuid() (Uuid, error)

func DecodeUuid added in v0.6.0

func DecodeUuid(v []byte) Uuid

func ParseUuid added in v0.6.0

func ParseUuid(str string) (Uuid, error)

func (Uuid) ClockSequence added in v0.6.0

func (d Uuid) ClockSequence() int

func (Uuid) Compare added in v0.6.0

func (d Uuid) Compare(other Uuid) int

func (Uuid) Eq added in v0.6.0

func (d Uuid) Eq(other Uuid) bool

func (Uuid) Ge added in v0.6.0

func (d Uuid) Ge(other Uuid) bool

func (Uuid) Gt added in v0.6.0

func (d Uuid) Gt(other Uuid) bool

func (Uuid) Le added in v0.6.0

func (d Uuid) Le(other Uuid) bool

func (Uuid) Lt added in v0.6.0

func (d Uuid) Lt(other Uuid) bool

func (Uuid) Ne added in v0.6.0

func (d Uuid) Ne(other Uuid) bool

func (Uuid) ToString added in v0.6.0

func (d Uuid) ToString() string

type Varlena added in v0.6.0

type Varlena [VarlenaSize]byte

func BuildVarlena added in v0.6.0

func BuildVarlena(bs []byte, area []byte, m *mpool.MPool) (Varlena, []byte, error)

func (*Varlena) ByteSlice added in v0.6.0

func (v *Varlena) ByteSlice() []byte

func (*Varlena) GetByteSlice added in v0.6.0

func (v *Varlena) GetByteSlice(area []byte) []byte

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) GetString added in v0.6.0

func (v *Varlena) GetString(area []byte) string

See the lifespan comment above.

func (*Varlena) IsSmall added in v0.6.0

func (v *Varlena) IsSmall() bool

func (*Varlena) OffsetLen added in v0.6.0

func (v *Varlena) OffsetLen() (uint32, uint32)

func (*Varlena) Reset added in v0.6.0

func (v *Varlena) Reset()

func (*Varlena) SetOffsetLen added in v0.6.0

func (v *Varlena) SetOffsetLen(voff, vlen uint32)

func (*Varlena) U32Slice added in v0.6.0

func (v *Varlena) U32Slice() []uint32

func (*Varlena) UnsafePtr added in v0.7.0

func (v *Varlena) UnsafePtr() unsafe.Pointer

type Weekday

type Weekday uint8
const (
	Sunday Weekday = iota
	Monday
	Tuesday
	Wednesday
	Thursday
	Friday
	Saturday
)

func (Weekday) String added in v0.6.0

func (d Weekday) String() string

String returns the English name of the day ("Sunday", "Monday", ...).

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL