Documentation
¶
Index ¶
- Constants
- type AnyDataColumn
- type Bool3VL
- type CastFunc
- type Complex
- type DataColumnType
- type EnumeratorFunc
- type Filter3VLFunc
- type FilterFunc
- type FilterGenFunc
- type FilterInfo
- type FilterOp
- type FilterStackLeaf
- type Float
- type FormulaInfo
- type Int
- type Nullable
- type Ordered
- type SelectInfo
- type SortFunc
- type SortInfo
- type TimeRange
- type Uint
- type ValueRange
Constants ¶
View Source
const (
Op_FastOp_Magic = Op_Fast_Eq - Op_Eq // magic number for fast operators
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AnyDataColumn ¶
type AnyDataColumn interface {
// True if the data is owned by the column. Otherwise, it is borrowed.
IsOwned() bool
// Own the data. If the data is borrowed before the call, it copies.
Own()
// Borrow the data.
BorrowAsAny() AnyDataColumn
// Get the column data type.
GetType() DataColumnType
// If the column is non virtual, return the implementation instance. Otherwise, it returns itself.
GetImpl() AnyDataColumn
// Get the column length.
Len() int
// Get the column capacity.
Cap() int
// Resize the column.
Resize(n int)
// Resize the column. It is similar to Resize but it is for grow length.
Grow(n int)
// Check the value at the index is null.
IsNull(i int) bool
// Cast the value to the column type and return it as interface{}.
CastAsAny(v interface{}) (interface{}, bool)
// Cast the value to the array of column type and return it as interface{}.
CastArrayAsAny(v interface{}) (interface{}, bool)
// Get the value at the index as interface{}.
GetAny(i int) interface{}
// Set the interface{} value at the index.
SetAny(i int, v interface{}) error
// Set the interface{} value at the index without type casting.
SetAnyNoCast(i int, v interface{}) error
// Fill the column with the interface{} value.
FillAny(s, e int, v interface{}) error
// Get the raw values as interface{}.
GetRawValuesAsAny() interface{}
// Sort the column.
Sort(less func(a, b int) bool)
// Reverse the column.
Reverse()
// Copy the column.
CopyAsAny() AnyDataColumn
// Shallow copy the column with range.
SliceAsAny(offset, limit int) AnyDataColumn
// Iterate the column.
For(iter EnumeratorFunc)
// Iterate the column with filter.
Filter(filter FilterFunc, iter EnumeratorFunc)
// Append the values to the column.
AppendAny(values ...interface{}) error
// Append the values that have the another column.
AppendAnyDataColumn(dc AnyDataColumn) error
// Get the 2VL filter function for the column.
GetFilter2VL(op FilterOp, v interface{}) (FilterGenFunc, error)
// Get the 3VL filter function for the column.
GetFilter3VL(op FilterOp, v interface{}) (FilterGenFunc, error)
// Get the sort function for the column.
GetSort(desc bool, nullsLast bool) SortFunc
// Make the buffer for the column.
MakeBufferAsAny(c int) interface{}
// Copy indexed values to the buffer. `buf` will be sliced to the length of `index`.
CopyBufferByIndex(buf *interface{}, index []int)
// Copy indexed values from the `src` DataColumn to this DataColumn.
// `dstRowMap` and `srcRowMap` are indices of rows to copy.
// If `dstRowMap` is nil, it uses index number of `srcRowMap` as the destination index.
FillByRowMap(dstRowMap []int, src AnyDataColumn, srcRowMap []int)
}
type Complex ¶
type Complex interface {
~complex64 | ~complex128
}
type DataColumnType ¶
type DataColumnType int
DataColumnType represents the type of data column.
const ( Type_Mask_Element DataColumnType = 0x00ff // Mask for element type. e.g. (Type_I64|Type_Flag_Nullable|Type_Flag_Array) & Type_Mask_Element == Type_I64 Type_Flag_ValueRange DataColumnType = 0x0080 // Flag that indicates the type is `ValueRange[T]`. It is part of element type. Type_Flag_Nullable DataColumnType = 0x0100 // Flag that indicates the type is `Nullable[T]`. Type_Flag_Array DataColumnType = 0x0200 // Flag that indicates the type is `[]T`. )
const ( Type_Invalid DataColumnType = iota // Invalid element type. It is not part of element type. Type_Start_Types // Start of element types. It is not part of element type. Type_Any DataColumnType = iota - 1 // Indicates `interface{}`. Type_I8 // Indicates `int8`. Type_I16 // Indicates `int16`. Type_I32 // Indicates `int32`. Type_I64 // Indicates `int64`. Type_Int // Indicates `int`. Type_U8 // Indicates `uint8`. Type_U16 // Indicates `uint16`. Type_U32 // Indicates `uint32`. Type_U64 // Indicates `uint64`. Type_Uint // Indicates `uint`. Type_UintPtr // Indicates `uintptr`. Type_F32 // Indicates `float32`. Type_F64 // Indicates `float64`. Type_Complex64 // Indicates `complex64`. Type_Complex128 // Indicates `complex128`. Type_Bool // Indicates `bool`. Type_String // Indicates `string`. Type_Blob // Indicates `[]byte`. Type_DateTime // Indicates `time.Time`. )
const ( Type_Nullable_Any DataColumnType = Type_Flag_Nullable + Type_Any + iota // Indicates `Nullable[interface{}]`. Type_Nullable_I8 // Indicates `Nullable[int8]`. Type_Nullable_I16 // Indicates `Nullable[int16]`. Type_Nullable_I32 // Indicates `Nullable[int32]`. Type_Nullable_I64 // Indicates `Nullable[int64]`. Type_Nullable_Int // Indicates `Nullable[int]`. Type_Nullable_U8 // Indicates `Nullable[uint8]`. Type_Nullable_U16 // Indicates `Nullable[uint16]`. Type_Nullable_U32 // Indicates `Nullable[uint32]`. Type_Nullable_U64 // Indicates `Nullable[uint64]`. Type_Nullable_Uint // Indicates `Nullable[uint]`. Type_Nullable_UintPtr // Indicates `Nullable[uintptr]`. Type_Nullable_F32 // Indicates `Nullable[float32]`. Type_Nullable_F64 // Indicates `Nullable[float64]`. Type_Nullable_Complex64 // Indicates `Nullable[complex64]`. Type_Nullable_Complex128 // Indicates `Nullable[complex128]`. Type_Nullable_Bool // Indicates `Nullable[bool]`. Type_Nullable_String // Indicates `Nullable[string]`. Type_Nullable_Blob // Indicates `Nullable[[]byte]`. Type_Nullable_DateTime // Indicates `Nullable[time.Time]`. )
const (
Type_DateTimeRange DataColumnType = Type_Flag_ValueRange + Type_DateTime + iota // Indicates `ValueRange[time.Time]`.
)
const (
Type_Nullable_DateTimeRange DataColumnType = Type_Flag_Nullable + Type_DateTimeRange + iota // Indicates `Nullable[ValueRange[time.Time]]`.
)
type EnumeratorFunc ¶
type EnumeratorFunc = func(i int)
type Filter3VLFunc ¶
type FilterFunc ¶
type FilterGenFunc ¶
type FilterGenFunc = func(filterStack *[]FilterStackLeaf) error
type FilterInfo ¶
type FilterInfo struct {
Op FilterOp // operator
Col int // column parameter
Param interface{} // other parameter
NArgs int // number of arguments
}
Filter information
type FilterOp ¶
type FilterOp int
Filter operator
const ( Op_Noop FilterOp = iota + 1 // no operation Op_Not // unary operator not Op_And // binary operator and Op_Or // binary operator or Op_Eq // binary operator = Op_NotEq // binary operator != Op_IsNull // unary operator isnull Op_IsNotNull // unary operator isnotnull Op_Lt // binary operator < Op_Le // binary operator <= Op_Gt // binary operator > Op_Ge // binary operator >= Op_Like // binary operator like Op_NotLike // binary operator not like Op_Match // binary operator match Op_NotMatch // binary operator not match Op_In // binary operator in Op_NotIn // binary operator not in Op_Includes // binary operator includes Op_Excludes // binary operator excludes Op_Fast_Eq // binary operator = Op_Fast_NotEq // binary operator != Op_Fast_IsNull // unary operator isnull Op_Fast_IsNotNull // unary operator isnotnull Op_Fast_Lt // binary operator < Op_Fast_Le // binary operator <= Op_Fast_Gt // binary operator > Op_Fast_Ge // binary operator >= Op_Fast_Like // binary operator like Op_Fast_NotLike // binary operator not like Op_Fast_Match // binary operator match Op_Fast_NotMatch // binary operator not match Op_Fast_In // binary operator in Op_Fast_NotIn // binary operator not in Op_Fast_Includes // binary operator includes Op_Fast_Excludes // binary operator excludes Op_LoadImmediate // load immediate value Op_LoadConst // load constant value Op_LoadVar // load variable value Op_LoadCol // load column value Op_LoadRowId // load rowid value Op_LoadPreviousCol // load previous column value Op_LoadPreviousRowId // load previous rowid value Op_LoadColAsList // load column values as list Op_LoadRowIdsAsList // load rowid values as list Op_Call // call function )
type FilterStackLeaf ¶
type FilterStackLeaf struct {
Type DataColumnType
Fn Filter3VLFunc
IsCol bool
IsConst bool
}
Filter stack item value
type Nullable ¶
Nullable value
func NewNullableAsNull ¶
Construct a new nullable value with null value
func (Nullable[T]) MarshalJSON ¶
func (*Nullable[T]) UnmarshalJSON ¶
type Ordered ¶
type Ordered interface {
~int | ~int8 | ~int16 | ~int32 | ~int64 |
~uint | ~uint8 | ~uint16 | ~uint32 | ~uint64 | ~uintptr |
~float32 | ~float64 | ~string
}
TODO: constraints.Ordered
type SelectInfo ¶
type SelectInfo struct {
Col int // simple result column
Formula []FormulaInfo // complex result column
As string // column alias name
}
Select information
Click to show internal directories.
Click to hide internal directories.