column

package
v3.0.0-beta7 Latest Latest
Warning

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

Go to latest
Published: May 21, 2024 License: MIT Imports: 15 Imported by: 3

Documentation

Index

Constants

View Source
const (
	// Uint8Size data Size of Uint8 Column
	Uint8Size = 1
	// Uint16Size data Size of Uint16 Column
	Uint16Size = 2
	// Uint32Size data Size of Uint32 Column
	Uint32Size = 4
	// Uint64Size data Size of Uint64 Column
	Uint64Size = 8
	// Uint128Size data Size of Uint128 Column
	Uint128Size = 16
	// Uint256Size data Size of Uint256 Column
	Uint256Size = 32
	// Int8Size data Size of Int8 Column
	Int8Size = 1
	// Int16Size data Size of Int16 Column
	Int16Size = 2
	// Int32Size data Size of Int32 Column
	Int32Size = 4
	// Int64Size data Size of Int64 Column
	Int64Size = 8
	// Int128Size data Size of Int128 Column
	Int128Size = 16
	// Int256Size data Size of Int256 Column
	Int256Size = 32
	// Float32Size data Size of Float32 Column
	Float32Size = 4
	// Float64Size data Size of Float64 Column
	Float64Size = 8
	// DateSize data Size of Date Column
	DateSize = 2
	// Date32Size data Size of Date32 Column
	Date32Size = 4
	// DatetimeSize data Size of DateTime Column
	DateTimeSize = 4
	// Datetime64Size data Size of DateTime64 Column
	DateTime64Size = 8
	// IPv4Size data Size of IPv4 Column
	IPv4Size = 4
	// IPv6Size data Size of IPv6 Column
	IPv6Size = 16
	// Decimal32Size data Size of Decimal32 Column
	Decimal32Size = 4
	// Decimal64Size data Size of Decimal64 Column
	Decimal64Size = 8
	// Decimal128Size data Size of Decimal128 Column
	Decimal128Size = 16
	// Decimal256Size data Size of Decimal256 Column
	Decimal256Size = 32
	// ArraylenSize data Size of Arraylen Column
	ArraylenSize = 8
	// MaplenSize data Size of Maplen Column
	MaplenSize = 8
	// UUIDSize data Size of UUID Column
	UUIDSize = 16
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Array

type Array[T any] struct {
	ArrayBase
	// contains filtered or unexported fields
}

Array is a column of Array(T) ClickHouse data type

func NewArray

func NewArray[T any](dataColumn Column[T]) *Array[T]

NewArray create a new array column of Array(T) ClickHouse data type

func NewNested1

func NewNested1[T any](
	column1 Column[T],
) *Array[T]

NewNested1 create a new nested of Nested(T1) ClickHouse data type

this is actually an alias for NewTuple1(T1).Array()

func NewNested2

func NewNested2[T ~struct {
	Col1 T1
	Col2 T2
}, T1, T2 any](
	column1 Column[T1],
	column2 Column[T2],
) *Array[T]

NewNested2 create a new nested of Nested(T1, T2) ClickHouse data type

this is actually an alias for NewTuple2(T1, T2).Array()

func NewNested3

func NewNested3[T ~struct {
	Col1 T1
	Col2 T2
	Col3 T3
}, T1, T2, T3 any](
	column1 Column[T1],
	column2 Column[T2],
	column3 Column[T3],
) *Array[T]

NewNested3 create a new nested of Nested(T1, T2, T3) ClickHouse data type

this is actually an alias for NewTuple3(T1, T2, T3).Array()

func NewNested4

func NewNested4[T ~struct {
	Col1 T1
	Col2 T2
	Col3 T3
	Col4 T4
}, T1, T2, T3, T4 any](
	column1 Column[T1],
	column2 Column[T2],
	column3 Column[T3],
	column4 Column[T4],
) *Array[T]

NewNested4 create a new nested of Nested(T1, T2, T3, T4) ClickHouse data type

this is actually an alias for NewTuple4(T1, T2, T3, T4).Array()

func NewNested5

func NewNested5[T ~struct {
	Col1 T1
	Col2 T2
	Col3 T3
	Col4 T4
	Col5 T5
}, T1, T2, T3, T4, T5 any](
	column1 Column[T1],
	column2 Column[T2],
	column3 Column[T3],
	column4 Column[T4],
	column5 Column[T5],
) *Array[T]

NewNested5 create a new nested of Nested(T1, T2, T3, T4, T5) ClickHouse data type

this is actually an alias for NewTuple5(T1, T2, T3, T4, T5).Array()

func (*Array[T]) Append

func (c *Array[T]) Append(v []T)

Append value for insert

func (*Array[T]) AppendAny

func (c *Array[T]) AppendAny(value any) error

func (*Array) AppendErr

func (c *Array) AppendErr() error

func (*Array[T]) AppendItem

func (c *Array[T]) AppendItem(v T)

Append single item value for insert

it should use with AppendLen

Example:

c.AppendLen(2) // insert 2 items
c.AppendItem(1)
c.AppendItem(2)

func (*Array[T]) AppendMulti

func (c *Array[T]) AppendMulti(v ...[]T)

AppendMulti value for insert

func (*Array[T]) Array

func (c *Array[T]) Array() *Array2[T]

Array return a Array type for this column

func (*Array[T]) Data

func (c *Array[T]) Data() [][]T

Data get all the data in current block as a slice.

func (*Array) Name

func (c *Array) Name() []byte

Name get name of the column

func (*Array[T]) Read

func (c *Array[T]) Read(value [][]T) [][]T

Read reads all the data in current block and append to the input.

func (*Array[T]) Row

func (c *Array[T]) Row(row int) []T

Row return the value of given row. NOTE: Row number start from zero

func (*Array[T]) RowAny

func (c *Array[T]) RowAny(row int) any

RowAny return the value of given row. NOTE: Row number start from zero

func (*Array[T]) Scan

func (c *Array[T]) Scan(row int, dest any) error

func (*Array) SetName

func (c *Array) SetName(v []byte)

SetName set name of the column

func (*Array) SetType

func (c *Array) SetType(v []byte)

SetType set clickhouse type

func (*Array[T]) ToJSON

func (c *Array[T]) ToJSON(row int, ignoreDoubleQuotes bool, b []byte) []byte

func (*Array) Type

func (c *Array) Type() []byte

Type get clickhouse type

type Array2

type Array2[T any] struct {
	ArrayBase
	// contains filtered or unexported fields
}

Array2 is a column of Array(Array(T)) ClickHouse data type

func NewArray2

func NewArray2[T any](array *Array[T]) *Array2[T]

NewArray create a new array column of Array(Array(T)) ClickHouse data type

func (*Array2[T]) Append

func (c *Array2[T]) Append(v [][]T)

func (*Array2[T]) AppendAny

func (c *Array2[T]) AppendAny(value any) error

func (*Array2) AppendErr

func (c *Array2) AppendErr() error

func (*Array2[T]) AppendMulti

func (c *Array2[T]) AppendMulti(v ...[][]T)

AppendMulti value for insert

func (*Array2[T]) Array

func (c *Array2[T]) Array() *Array3[T]

Array return a Array type for this column

func (*Array2[T]) Data

func (c *Array2[T]) Data() [][][]T

Data get all the data in current block as a slice.

func (*Array2) Name

func (c *Array2) Name() []byte

Name get name of the column

func (*Array2[T]) Read

func (c *Array2[T]) Read(value [][][]T) [][][]T

Read reads all the data in current block and append to the input.

func (*Array2[T]) Row

func (c *Array2[T]) Row(row int) [][]T

Row return the value of given row. NOTE: Row number start from zero

func (*Array2[T]) RowAny

func (c *Array2[T]) RowAny(row int) any

RowAny return the value of given row. NOTE: Row number start from zero

func (*Array2[T]) Scan

func (c *Array2[T]) Scan(row int, dest any) error

func (*Array2) SetName

func (c *Array2) SetName(v []byte)

SetName set name of the column

func (*Array2) SetType

func (c *Array2) SetType(v []byte)

SetType set clickhouse type

func (*Array2[T]) ToJSON

func (c *Array2[T]) ToJSON(row int, ignoreDoubleQuotes bool, b []byte) []byte

func (*Array2) Type

func (c *Array2) Type() []byte

Type get clickhouse type

type Array2Nullable

type Array2Nullable[T any] struct {
	Array2[T]
	// contains filtered or unexported fields
}

Array is a column of Array(Array(Nullable(T))) ClickHouse data type

func NewArray2Nullable

func NewArray2Nullable[T any](dataColumn *ArrayNullable[T]) *Array2Nullable[T]

NewArrayNullable create a new array column of Array(Nullable(T)) ClickHouse data type

func (*Array2Nullable[T]) Append

func (c *Array2Nullable[T]) Append(v [][]T)

func (*Array2Nullable[T]) AppendAny

func (c *Array2Nullable[T]) AppendAny(value any) error

func (*Array2Nullable) AppendErr

func (c *Array2Nullable) AppendErr() error

func (*Array2Nullable[T]) AppendMultiP

func (c *Array2Nullable[T]) AppendMultiP(v ...[][]*T)

AppendMultiP a nullable value for insert

func (*Array2Nullable[T]) AppendP

func (c *Array2Nullable[T]) AppendP(v [][]*T)

AppendP a nullable value for insert

func (*Array2Nullable[T]) Array

func (c *Array2Nullable[T]) Array() *Array3Nullable[T]

Array return a Array type for this column

func (*Array2Nullable[T]) DataP

func (c *Array2Nullable[T]) DataP() [][][]*T

Data get all the nullable data in current block as a slice of pointer.

func (*Array2Nullable) Name

func (c *Array2Nullable) Name() []byte

Name get name of the column

func (*Array2Nullable[T]) ReadP

func (c *Array2Nullable[T]) ReadP(value [][][]*T) [][][]*T

Read reads all the nullable data in current block as a slice pointer and append to the input.

func (*Array2Nullable[T]) ReadRaw

func (c *Array2Nullable[T]) ReadRaw(num int, r *readerwriter.Reader) error

ReadRaw read raw data from the reader. it runs automatically

func (*Array2Nullable[T]) RowAny

func (c *Array2Nullable[T]) RowAny(row int) any

RowAny return the value of given row. NOTE: Row number start from zero

func (*Array2Nullable[T]) RowP

func (c *Array2Nullable[T]) RowP(row int) [][]*T

RowP return the nullable value of given row as a pointer NOTE: Row number start from zero

func (*Array2Nullable[T]) Scan

func (c *Array2Nullable[T]) Scan(row int, dest any) error

func (*Array2Nullable) SetName

func (c *Array2Nullable) SetName(v []byte)

SetName set name of the column

func (*Array2Nullable) SetType

func (c *Array2Nullable) SetType(v []byte)

SetType set clickhouse type

func (*Array2Nullable[T]) ToJSON

func (c *Array2Nullable[T]) ToJSON(row int, ignoreDoubleQuotes bool, b []byte) []byte

func (*Array2Nullable) Type

func (c *Array2Nullable) Type() []byte

Type get clickhouse type

type Array3

type Array3[T any] struct {
	ArrayBase
	// contains filtered or unexported fields
}

Array3 is a column of Array(Array(Array(T))) ClickHouse data type

func NewArray3

func NewArray3[T any](array *Array2[T]) *Array3[T]

NewArray create a new array column of Array(Array(Array(T))) ClickHouse data type

func (*Array3[T]) Append

func (c *Array3[T]) Append(v [][][]T)

Append value for insert

func (*Array3[T]) AppendAny

func (c *Array3[T]) AppendAny(value any) error

func (*Array3) AppendErr

func (c *Array3) AppendErr() error

func (*Array3[T]) AppendMulti

func (c *Array3[T]) AppendMulti(v ...[][][]T)

AppendMulti value for insert

func (*Array3[T]) Data

func (c *Array3[T]) Data() [][][][]T

Data get all the data in current block as a slice.

func (*Array3) Name

func (c *Array3) Name() []byte

Name get name of the column

func (*Array3[T]) Read

func (c *Array3[T]) Read(value [][][][]T) [][][][]T

Read reads all the data in current block and append to the input.

func (*Array3[T]) Row

func (c *Array3[T]) Row(row int) [][][]T

Row return the value of given row. NOTE: Row number start from zero

func (*Array3[T]) RowAny

func (c *Array3[T]) RowAny(row int) any

RowAny return the value of given row. NOTE: Row number start from zero

func (*Array3[T]) Scan

func (c *Array3[T]) Scan(row int, dest any) error

func (*Array3) SetName

func (c *Array3) SetName(v []byte)

SetName set name of the column

func (*Array3) SetType

func (c *Array3) SetType(v []byte)

SetType set clickhouse type

func (*Array3[T]) ToJSON

func (c *Array3[T]) ToJSON(row int, ignoreDoubleQuotes bool, b []byte) []byte

func (*Array3) Type

func (c *Array3) Type() []byte

Type get clickhouse type

type Array3Nullable

type Array3Nullable[T any] struct {
	Array3[T]
	// contains filtered or unexported fields
}

Array is a column of Array(Array(Nullable(T))) ClickHouse data type

func NewArray3Nullable

func NewArray3Nullable[T any](dataColumn *Array2Nullable[T]) *Array3Nullable[T]

NewArrayNullable create a new array column of Array(Nullable(T)) ClickHouse data type

func (*Array3Nullable[T]) AppendAny

func (c *Array3Nullable[T]) AppendAny(value any) error

func (*Array3Nullable) AppendErr

func (c *Array3Nullable) AppendErr() error

func (*Array3Nullable[T]) AppendMultiP

func (c *Array3Nullable[T]) AppendMultiP(v ...[][][]*T)

AppendMultiP a nullable value for insert

func (*Array3Nullable[T]) AppendP

func (c *Array3Nullable[T]) AppendP(v [][][]*T)

AppendP a nullable value for insert

func (*Array3Nullable[T]) DataP

func (c *Array3Nullable[T]) DataP() [][][][]*T

Data get all the nullable data in current block as a slice of pointer.

func (*Array3Nullable) Name

func (c *Array3Nullable) Name() []byte

Name get name of the column

func (*Array3Nullable[T]) ReadP

func (c *Array3Nullable[T]) ReadP(value [][][][]*T) [][][][]*T

Read reads all the nullable data in current block as a slice pointer and append to the input.

func (*Array3Nullable[T]) ReadRaw

func (c *Array3Nullable[T]) ReadRaw(num int, r *readerwriter.Reader) error

ReadRaw read raw data from the reader. it runs automatically

func (*Array3Nullable[T]) RowAny

func (c *Array3Nullable[T]) RowAny(row int) any

RowAny return the value of given row. NOTE: Row number start from zero

func (*Array3Nullable[T]) RowP

func (c *Array3Nullable[T]) RowP(row int) [][][]*T

RowP return the nullable value of given row as a pointer NOTE: Row number start from zero

func (*Array3Nullable[T]) Scan

func (c *Array3Nullable[T]) Scan(row int, dest any) error

func (*Array3Nullable) SetName

func (c *Array3Nullable) SetName(v []byte)

SetName set name of the column

func (*Array3Nullable) SetType

func (c *Array3Nullable) SetType(v []byte)

SetType set clickhouse type

func (*Array3Nullable[T]) ToJSON

func (c *Array3Nullable[T]) ToJSON(row int, ignoreDoubleQuotes bool, b []byte) []byte

func (*Array3Nullable) Type

func (c *Array3Nullable) Type() []byte

Type get clickhouse type

type ArrayBase

type ArrayBase struct {
	// contains filtered or unexported fields
}

ArrayBase is a column of Array(T) ClickHouse data type

ArrayBase is a base class for other arrays or use for none generic use

func NewArrayBase

func NewArrayBase(dataColumn ColumnBasic) *ArrayBase

NewArray create a new array column of Array(T) ClickHouse data type

func NewNested

func NewNested(columns ...ColumnBasic) *ArrayBase

NewNested create a new nested of Nested(T1,T2,.....,Tn) ClickHouse data type

this is actually an alias for NewTuple(T1,T2,.....,Tn).Array()

func (*ArrayBase) AppendAny

func (c *ArrayBase) AppendAny(value any) error

func (*ArrayBase) AppendErr

func (c *ArrayBase) AppendErr() error

func (*ArrayBase) AppendLen

func (c *ArrayBase) AppendLen(v int)

AppendLen Append len of array for insert

func (*ArrayBase) Array

func (c *ArrayBase) Array() *ArrayBase

Array return a Array type for this column

func (*ArrayBase) Column

func (c *ArrayBase) Column() ColumnBasic

Column returns the sub column

func (*ArrayBase) FullType

func (c *ArrayBase) FullType() string

func (*ArrayBase) HeaderReader

func (c *ArrayBase) HeaderReader(r *readerwriter.Reader, readColumn bool, revision uint64) error

HeaderReader reads header data from reader it uses internally

func (*ArrayBase) HeaderWriter

func (c *ArrayBase) HeaderWriter(w *readerwriter.Writer)

HeaderWriter writes header data to writer it uses internally

func (*ArrayBase) Name

func (c *ArrayBase) Name() []byte

Name get name of the column

func (*ArrayBase) NumRow

func (c *ArrayBase) NumRow() int

NumRow return number of row for this block

func (*ArrayBase) Offsets

func (c *ArrayBase) Offsets() []uint64

Offsets return all the offsets in current block Note: Only available in the current block

func (*ArrayBase) ReadRaw

func (c *ArrayBase) ReadRaw(num int, r *readerwriter.Reader) error

ReadRaw read raw data from the reader. it runs automatically

func (*ArrayBase) Remove

func (c *ArrayBase) Remove(n int)

Remove inserted value from index

its equal to data = data[:n]

func (*ArrayBase) Reset

func (c *ArrayBase) Reset()

Reset all statuses and buffered data

After each reading, the reading data does not need to be reset. It will be automatically reset.

When inserting, buffers are reset only after the operation is successful. If an error occurs, you can safely call insert again.

func (*ArrayBase) RowAny

func (c *ArrayBase) RowAny(row int) any

func (*ArrayBase) Scan

func (c *ArrayBase) Scan(row int, dest any) error

func (*ArrayBase) ScanValue

func (c *ArrayBase) ScanValue(row int, dest reflect.Value) error

func (*ArrayBase) SetName

func (c *ArrayBase) SetName(v []byte)

SetName set name of the column

func (*ArrayBase) SetType

func (c *ArrayBase) SetType(v []byte)

SetType set clickhouse type

func (*ArrayBase) SetWriteBufferSize

func (c *ArrayBase) SetWriteBufferSize(row int)

SetWriteBufferSize set write buffer (number of rows) this buffer only used for writing. By setting this buffer, you will avoid allocating the memory several times.

func (*ArrayBase) ToJSON

func (c *ArrayBase) ToJSON(row int, ignoreDoubleQuotes bool, b []byte) []byte

func (*ArrayBase) TotalRows

func (c *ArrayBase) TotalRows() int

TotalRows return total rows on this block of array data

func (*ArrayBase) Type

func (c *ArrayBase) Type() []byte

Type get clickhouse type

func (*ArrayBase) Validate

func (c *ArrayBase) Validate(forInsert bool) error

func (*ArrayBase) WriteTo

func (c *ArrayBase) WriteTo(w io.Writer) (int64, error)

WriteTo write data to ClickHouse. it uses internally

type ArrayNullable

type ArrayNullable[T any] struct {
	// contains filtered or unexported fields
}

Array is a column of Array(Nullable(T)) ClickHouse data type

func NewArrayNullable

func NewArrayNullable[T any](dataColumn NullableColumn[T]) *ArrayNullable[T]

NewArrayNullable create a new array column of Array(Nullable(T)) ClickHouse data type

func (*ArrayNullable[T]) AppendAny

func (c *ArrayNullable[T]) AppendAny(value any) error

func (*ArrayNullable[T]) AppendItemP

func (c *ArrayNullable[T]) AppendItemP(v *T)
AppendItemP Append nullable item value for insert

it should use with AppendLen

Example:

c.AppendLen(2) // insert 2 items
c.AppendItemP(val1) // insert item 1
c.AppendItemP(val2) // insert item 2

func (*ArrayNullable[T]) AppendMultiP

func (c *ArrayNullable[T]) AppendMultiP(v [][]*T)

AppendMultiP a nullable value for insert

func (*ArrayNullable[T]) AppendP

func (c *ArrayNullable[T]) AppendP(v []*T)

AppendP a nullable value for insert

func (*ArrayNullable[T]) Array

func (c *ArrayNullable[T]) Array() *Array2Nullable[T]

ArrayOf return a Array type for this column

func (*ArrayNullable[T]) DataP

func (c *ArrayNullable[T]) DataP() [][]*T

Data get all the nullable data in current block as a slice of pointer.

func (*ArrayNullable[T]) ReadP

func (c *ArrayNullable[T]) ReadP(value [][]*T) [][]*T

Read reads all the nullable data in current block as a slice pointer and append to the input.

func (*ArrayNullable[T]) ReadRaw

func (c *ArrayNullable[T]) ReadRaw(num int, r *readerwriter.Reader) error

ReadRaw read raw data from the reader. it runs automatically

func (*ArrayNullable[T]) RowAny

func (c *ArrayNullable[T]) RowAny(row int) any

RowAny return the value of given row. NOTE: Row number start from zero

func (*ArrayNullable[T]) RowP

func (c *ArrayNullable[T]) RowP(row int) []*T

RowP return the nullable value of given row as a pointer NOTE: Row number start from zero

func (*ArrayNullable[T]) Scan

func (c *ArrayNullable[T]) Scan(row int, dest any) error

func (*ArrayNullable[T]) ToJSON

func (c *ArrayNullable[T]) ToJSON(row int, ignoreDoubleQuotes bool, b []byte) []byte

type Base

type Base[T BaseType] struct {
	// contains filtered or unexported fields
}

Column use for most (fixed size) ClickHouse Columns type

func New

func New[T BaseType]() *Base[T]

New create a new column

func (*Base[T]) Append

func (c *Base[T]) Append(v T)

Append value for insert

func (*Base[T]) AppendAny

func (c *Base[T]) AppendAny(value any) error

func (*Base) AppendErr

func (c *Base) AppendErr() error

func (*Base[T]) AppendMulti

func (c *Base[T]) AppendMulti(v ...T)

AppendMulti value for insert

func (*Base[T]) Array

func (c *Base[T]) Array() *Array[T]

Array return a Array type for this column

func (*Base[T]) Data

func (c *Base[T]) Data() []T

Data get all the data in current block as a slice.

NOTE: the return slice only valid in current block, if you want to use it after, you should copy it. or use Read

func (*Base[T]) Elem

func (c *Base[T]) Elem(arrayLevel int, nullable, lc bool) ColumnBasic

func (*Base[T]) FullType

func (c *Base[T]) FullType() string

func (*Base[T]) HeaderReader

func (c *Base[T]) HeaderReader(r *readerwriter.Reader, readColumn bool, revision uint64) error

HeaderReader reads header data from reader it uses internally

func (*Base[T]) HeaderWriter

func (c *Base[T]) HeaderWriter(w *readerwriter.Writer)

HeaderWriter writes header data to writer it uses internally

func (*Base[T]) LC

func (c *Base[T]) LC() *LowCardinality[T]

LC return a low cardinality type for this column

func (*Base[T]) LowCardinality

func (c *Base[T]) LowCardinality() *LowCardinality[T]

LowCardinality return a low cardinality type for this column

func (*Base) Name

func (c *Base) Name() []byte

Name get name of the column

func (*Base[T]) Nullable

func (c *Base[T]) Nullable() *BaseNullable[T]

Nullable return a nullable type for this column

func (*Base[T]) NumRow

func (c *Base[T]) NumRow() int

NumRow return number of row for this block

func (*Base[T]) Read

func (c *Base[T]) Read(value []T) []T

Read reads all the data in current block and append to the input.

func (*Base[T]) ReadRaw

func (c *Base[T]) ReadRaw(num int, r *readerwriter.Reader) error

ReadRaw read raw data from the reader. it runs automatically

func (*Base[T]) Remove

func (c *Base[T]) Remove(n int)

Remove inserted value from index

its equal to data = data[:n]

func (*Base[T]) Reset

func (c *Base[T]) Reset()

Reset all statuses and buffered data

After each reading, the reading data does not need to be reset. It will be automatically reset.

When inserting, buffers are reset only after the operation is successful. If an error occurs, you can safely call insert again.

func (*Base[T]) Row

func (c *Base[T]) Row(row int) T

Row return the value of given row. NOTE: Row number start from zero

func (*Base[T]) RowAny

func (c *Base[T]) RowAny(row int) any

RowAny return the value of given row. NOTE: Row number start from zero

func (*Base[T]) Scan

func (c *Base[T]) Scan(row int, dest any) error

func (*Base) SetName

func (c *Base) SetName(v []byte)

SetName set name of the column

func (*Base[T]) SetStrict

func (c *Base[T]) SetStrict(strict bool) *Base[T]

func (*Base) SetType

func (c *Base) SetType(v []byte)

SetType set clickhouse type

func (*Base[T]) SetWriteBufferSize

func (c *Base[T]) SetWriteBufferSize(row int)

SetWriteBufferSize set write buffer (number of rows) this buffer only used for writing. By setting this buffer, you will avoid allocating the memory several times.

func (*Base[T]) ToJSON

func (c *Base[T]) ToJSON(row int, ignoreDoubleQuotes bool, b []byte) []byte

func (*Base) Type

func (c *Base) Type() []byte

Type get clickhouse type

func (*Base[T]) Validate

func (c *Base[T]) Validate(forInsert bool) error

func (*Base[T]) WriteTo

func (c *Base[T]) WriteTo(w io.Writer) (int64, error)

type BaseNullable

type BaseNullable[T BaseType] struct {
	// contains filtered or unexported fields
}

BaseNullable is a column of Nullable(T) ClickHouse data type

func NewBaseNullable

func NewBaseNullable[T BaseType](dataColumn *Base[T]) *BaseNullable[T]

NewBaseNullable return new BaseNullable for BaseNullable(T) ClickHouse DataType

func (*BaseNullable[T]) Append

func (c *BaseNullable[T]) Append(v T)

Append value for insert

func (*BaseNullable[T]) AppendAny

func (c *BaseNullable[T]) AppendAny(value any) error

func (*BaseNullable) AppendErr

func (c *BaseNullable) AppendErr() error

func (*BaseNullable[T]) AppendMulti

func (c *BaseNullable[T]) AppendMulti(v ...T)

AppendMulti value for insert

func (*BaseNullable[T]) AppendMultiP

func (c *BaseNullable[T]) AppendMultiP(v ...*T)

AppendMultiP nullable value for insert

as an alternative (for better performance), you can use `Append` and `AppendNil` to insert a value

func (*BaseNullable[T]) AppendNil

func (c *BaseNullable[T]) AppendNil()

Append nil value for insert

func (*BaseNullable[T]) AppendP

func (c *BaseNullable[T]) AppendP(v *T)

AppendP nullable value for insert

as an alternative (for better performance), you can use `Append` and `AppendNil` to insert a value

func (*BaseNullable[T]) Array

func (c *BaseNullable[T]) Array() *ArrayNullable[T]

Array return a Array type for this column

func (*BaseNullable[T]) Data

func (c *BaseNullable[T]) Data() []T

Data get all the data in current block as a slice.

NOTE: the return slice only valid in current block, if you want to use it after, you should copy it. or use Read

func (*BaseNullable[T]) DataNil

func (c *BaseNullable[T]) DataNil() []bool

DataNil get all nil state in this block

func (*BaseNullable[T]) DataP

func (c *BaseNullable[T]) DataP() []*T

Data get all the nullable data in current block as a slice of pointer.

As an alternative (for better performance). You can use `Data` and one of `RowIsNil` and `ReadNil` and `DataNil` to detect if value is null or not.

func (*BaseNullable[T]) FullType

func (c *BaseNullable[T]) FullType() string

func (*BaseNullable[T]) HeaderReader

func (c *BaseNullable[T]) HeaderReader(r *readerwriter.Reader, readColumn bool, revision uint64) error

HeaderReader reads header data from reader it uses internally

func (*BaseNullable[T]) HeaderWriter

func (c *BaseNullable[T]) HeaderWriter(w *readerwriter.Writer)

HeaderWriter writes header data to writer it uses internally

func (*BaseNullable) Name

func (c *BaseNullable) Name() []byte

Name get name of the column

func (*BaseNullable[T]) NumRow

func (c *BaseNullable[T]) NumRow() int

NumRow return number of row for this block

func (*BaseNullable[T]) Read

func (c *BaseNullable[T]) Read(value []T) []T

Read reads all the data in current block and append to the input.

func (*BaseNullable[T]) ReadNil

func (c *BaseNullable[T]) ReadNil(value []bool) []bool

ReadAll read all nils state in this block and append to the input

func (*BaseNullable[T]) ReadP

func (c *BaseNullable[T]) ReadP(value []*T) []*T

ReadP read all value in this block and append to the input slice (for nullable data)

As an alternative (for better performance), You can use `Read` and one of `RowIsNil` and `ReadNil` and `DataNil` to detect if value is null or not.

func (*BaseNullable[T]) ReadRaw

func (c *BaseNullable[T]) ReadRaw(num int, r *readerwriter.Reader) error

ReadRaw read raw data from the reader. it runs automatically

func (*BaseNullable[T]) Remove

func (c *BaseNullable[T]) Remove(n int)

Remove inserted value from index

its equal to data = data[:n]

func (*BaseNullable[T]) Reset

func (c *BaseNullable[T]) Reset()

Reset all statuses and buffered data

After each reading, the reading data does not need to be reset. It will be automatically reset.

When inserting, buffers are reset only after the operation is successful. If an error occurs, you can safely call insert again.

func (*BaseNullable[T]) Row

func (c *BaseNullable[T]) Row(i int) T

Append value for insert

func (*BaseNullable[T]) RowAny

func (c *BaseNullable[T]) RowAny(i int) any

Append value for insert

func (*BaseNullable[T]) RowIsNil

func (c *BaseNullable[T]) RowIsNil(row int) bool

RowIsNil return true if the row is null

func (*BaseNullable[T]) RowP

func (c *BaseNullable[T]) RowP(row int) *T

RowP return the value of given row for nullable data NOTE: Row number start from zero

As an alternative (for better performance), you can use `Row()` to get a value and `RowIsNil()` to check if it is null.

func (*BaseNullable[T]) Scan

func (c *BaseNullable[T]) Scan(row int, dest any) error

func (*BaseNullable) SetName

func (c *BaseNullable) SetName(v []byte)

SetName set name of the column

func (*BaseNullable) SetType

func (c *BaseNullable) SetType(v []byte)

SetType set clickhouse type

func (*BaseNullable[T]) SetWriteBufferSize

func (c *BaseNullable[T]) SetWriteBufferSize(row int)

SetWriteBufferSize set write buffer (number of rows) this buffer only used for writing. By setting this buffer, you will avoid allocating the memory several times.

func (*BaseNullable[T]) ToJSON

func (c *BaseNullable[T]) ToJSON(row int, ignoreDoubleQuotes bool, b []byte) []byte

func (*BaseNullable) Type

func (c *BaseNullable) Type() []byte

Type get clickhouse type

func (*BaseNullable[T]) Validate

func (c *BaseNullable[T]) Validate(forInsert bool) error

func (*BaseNullable[T]) WriteTo

func (c *BaseNullable[T]) WriteTo(w io.Writer) (int64, error)

WriteTo write data to ClickHouse. it uses internally

type BaseType

type BaseType interface {
	~uint8 | ~uint16 | ~uint32 | ~uint64 | ~int8 | ~int16 | ~int32 | ~int64 | ~float32 | ~float64 | ~bool |
		types.Int128 | types.Int256 | types.Uint128 | types.Uint256 | types.Decimal128 | types.Decimal256 |

		~[1]byte | ~[2]byte | ~[3]byte | ~[4]byte | ~[5]byte | ~[6]byte | ~[7]byte | ~[8]byte | ~[9]byte | ~[10]byte | ~[11]byte |
		~[12]byte | ~[13]byte | ~[14]byte | ~[15]byte | ~[16]byte | ~[17]byte | ~[18]byte | ~[19]byte | ~[20]byte |
		~[21]byte | ~[22]byte | ~[23]byte | ~[24]byte | ~[25]byte | ~[26]byte | ~[27]byte | ~[28]byte | ~[29]byte |
		~[30]byte | ~[31]byte | ~[32]byte | ~[33]byte | ~[34]byte | ~[35]byte | ~[36]byte | ~[37]byte | ~[38]byte |
		~[39]byte | ~[40]byte | ~[41]byte | ~[42]byte | ~[43]byte | ~[44]byte | ~[45]byte | ~[46]byte | ~[47]byte |
		~[48]byte | ~[49]byte | ~[50]byte | ~[51]byte | ~[52]byte | ~[53]byte | ~[54]byte | ~[55]byte | ~[56]byte |
		~[57]byte | ~[58]byte | ~[59]byte | ~[60]byte | ~[61]byte | ~[62]byte | ~[63]byte | ~[64]byte | ~[65]byte |
		~[66]byte | ~[67]byte | ~[68]byte | ~[69]byte | ~[70]byte | ~[71]byte | ~[72]byte | ~[73]byte | ~[74]byte
}

type Column

type Column[T any] interface {
	ColumnBasic
	Data() []T
	Read([]T) []T
	Row(int) T
	Append(T)
	AppendMulti(...T)
}

type ColumnBasic

type ColumnBasic interface {
	ReadRaw(num int, r *readerwriter.Reader) error
	HeaderReader(r *readerwriter.Reader, readColumn bool, revision uint64) error
	HeaderWriter(*readerwriter.Writer)
	WriteTo(io.Writer) (int64, error)
	NumRow() int
	Reset()
	SetType(v []byte)
	Type() []byte
	SetName(v []byte)
	Name() []byte
	Validate(forInsert bool) error

	SetWriteBufferSize(int)
	RowAny(int) any
	Scan(row int, dest any) error
	AppendAny(any) error

	FullType() string
	Remove(n int)
	ToJSON(row int, stringQuotes bool, b []byte) []byte
	// contains filtered or unexported methods
}

type Date

type Date[T DateType[T]] struct {
	Base[T]
	// contains filtered or unexported fields
}

Date is a date column of ClickHouse date type (Date, Date32, DateTime, DateTime64). it is a wrapper of time.Time. but if you want to work with the raw data like unix timestamp you can directly use `Column` (`New[T]()`)

`types.Date` data types For `Date`.

`types.Date32` data types For `Date32`

`types.DateTime` data types For `DateTime`

`types.DateTime64` data types For `DateTime64`

func NewDate

func NewDate[T DateType[T]]() *Date[T]

func (*Date[T]) Append

func (c *Date[T]) Append(v time.Time)

Append value for insert

func (*Date[T]) AppendAny

func (c *Date[T]) AppendAny(value any) error

func (*Date) AppendErr

func (c *Date) AppendErr() error

func (*Date[T]) AppendMulti

func (c *Date[T]) AppendMulti(v ...time.Time)

AppendMulti value for insert

func (*Date[T]) Array

func (c *Date[T]) Array() *Array[time.Time]

Array return a Array type for this column

func (*Date[T]) Data

func (c *Date[T]) Data() []time.Time

Data get all the data in current block as a slice.

func (*Date[T]) Elem

func (c *Date[T]) Elem(arrayLevel int, nullable, lc bool) ColumnBasic

func (*Date[T]) FullType

func (c *Date[T]) FullType() string

func (*Date[T]) LC

func (c *Date[T]) LC() *LowCardinality[time.Time]

LC return a low cardinality type for this column

func (*Date[T]) Location

func (c *Date[T]) Location() *time.Location

Location get location

ONLY ON SELECT: set automatically for `DateTime` and `DateTime64` if not set and present in clickhouse datatype)

func (*Date[T]) LowCardinality

func (c *Date[T]) LowCardinality() *LowCardinality[time.Time]

LowCardinality return a low cardinality type for this column

func (*Date) Name

func (c *Date) Name() []byte

Name get name of the column

func (*Date[T]) Nullable

func (c *Date[T]) Nullable() *DateNullable[T]

Nullable return a nullable type for this column

func (*Date[T]) Read

func (c *Date[T]) Read(value []time.Time) []time.Time

Read reads all the data in current block and append to the input.

func (*Date[T]) Row

func (c *Date[T]) Row(row int) time.Time

Row return the value of given row NOTE: Row number start from zero

func (*Date[T]) Scan

func (c *Date[T]) Scan(row int, dest any) error

func (*Date[T]) SetLocation

func (c *Date[T]) SetLocation(loc *time.Location) *Date[T]

SetLocation set the location of the time.Time. Only use for `DateTime` and `DateTime64`

func (*Date) SetName

func (c *Date) SetName(v []byte)

SetName set name of the column

func (*Date[T]) SetPrecision

func (c *Date[T]) SetPrecision(precision int) *Date[T]

SetPrecision set the precision of the time.Time. Only use for `DateTime64`

func (*Date) SetType

func (c *Date) SetType(v []byte)

SetType set clickhouse type

func (Date[T]) ToJSON

func (c Date[T]) ToJSON(row int, ignoreDoubleQuotes bool, b []byte) []byte

func (*Date) Type

func (c *Date) Type() []byte

Type get clickhouse type

type DateNullable

type DateNullable[T DateType[T]] struct {
	// contains filtered or unexported fields
}

DateNullable is a column of Nullable(T) ClickHouse data type

func NewDateNullable

func NewDateNullable[T DateType[T]](dataColumn *Date[T]) *DateNullable[T]

NewDateNullable return new DateNullable for DateNullable(T) ClickHouse DataType

func (*DateNullable[T]) Append

func (c *DateNullable[T]) Append(v time.Time)

Append value for insert

func (*DateNullable[T]) AppendAny

func (c *DateNullable[T]) AppendAny(value any) error

func (*DateNullable) AppendErr

func (c *DateNullable) AppendErr() error

func (*DateNullable[T]) AppendMulti

func (c *DateNullable[T]) AppendMulti(v ...time.Time)

AppendMulti value for insert

func (*DateNullable[T]) AppendMultiP

func (c *DateNullable[T]) AppendMultiP(v ...*time.Time)

AppendMultiP nullable value for insert

as an alternative (for better performance), you can use `Append` and `AppendNil` to insert a value

func (*DateNullable[T]) AppendNil

func (c *DateNullable[T]) AppendNil()

Append nil value for insert

func (*DateNullable[T]) AppendP

func (c *DateNullable[T]) AppendP(v *time.Time)

AppendP nullable value for insert

as an alternative (for better performance), you can use `Append` and `AppendNil` to insert a value

func (*DateNullable[T]) Array

func (c *DateNullable[T]) Array() *ArrayNullable[time.Time]

Array return a Array type for this column

func (*DateNullable[T]) Data

func (c *DateNullable[T]) Data() []time.Time

Data get all the data in current block as a slice.

NOTE: the return slice only valid in current block, if you want to use it after, you should copy it. or use Read

func (*DateNullable[T]) DataNil

func (c *DateNullable[T]) DataNil() []bool

DataNil get all nil state in this block

func (*DateNullable[T]) DataP

func (c *DateNullable[T]) DataP() []*time.Time

Data get all the nullable data in current block as a slice of pointer.

As an alternative (for better performance). You can use `Data` and one of `RowIsNil` and `ReadNil` and `DataNil` to detect if value is null or not.

func (*DateNullable[T]) FullType

func (c *DateNullable[T]) FullType() string

func (*DateNullable[T]) HeaderReader

func (c *DateNullable[T]) HeaderReader(r *readerwriter.Reader, readColumn bool, revision uint64) error

HeaderReader reads header data from reader it uses internally

func (*DateNullable[T]) HeaderWriter

func (c *DateNullable[T]) HeaderWriter(w *readerwriter.Writer)

HeaderWriter writes header data to writer it uses internally

func (*DateNullable) Name

func (c *DateNullable) Name() []byte

Name get name of the column

func (*DateNullable[T]) NumRow

func (c *DateNullable[T]) NumRow() int

NumRow return number of row for this block

func (*DateNullable[T]) Read

func (c *DateNullable[T]) Read(value []time.Time) []time.Time

Read reads all the data in current block and append to the input.

func (*DateNullable[T]) ReadNil

func (c *DateNullable[T]) ReadNil(value []bool) []bool

ReadAll read all nils state in this block and append to the input

func (*DateNullable[T]) ReadP

func (c *DateNullable[T]) ReadP(value []*time.Time) []*time.Time

ReadP read all value in this block and append to the input slice (for nullable data)

As an alternative (for better performance), You can use `Read` and one of `RowIsNil` and `ReadNil` and `DataNil` to detect if value is null or not.

func (*DateNullable[T]) ReadRaw

func (c *DateNullable[T]) ReadRaw(num int, r *readerwriter.Reader) error

ReadRaw read raw data from the reader. it runs automatically

func (*DateNullable[T]) Remove

func (c *DateNullable[T]) Remove(n int)

Remove inserted value from index

its equal to data = data[:n]

func (*DateNullable[T]) Reset

func (c *DateNullable[T]) Reset()

Reset all statuses and buffered data

After each reading, the reading data does not need to be reset. It will be automatically reset.

When inserting, buffers are reset only after the operation is successful. If an error occurs, you can safely call insert again.

func (*DateNullable[T]) Row

func (c *DateNullable[T]) Row(i int) time.Time

Row return the value of given row

func (*DateNullable[T]) RowAny

func (c *DateNullable[T]) RowAny(i int) any

RowAny return the value of given row

func (*DateNullable[T]) RowIsNil

func (c *DateNullable[T]) RowIsNil(row int) bool

RowIsNil return true if the row is null

func (*DateNullable[T]) RowP

func (c *DateNullable[T]) RowP(row int) *time.Time

RowP return the value of given row for nullable data NOTE: Row number start from zero

As an alternative (for better performance), you can use `Row()` to get a value and `RowIsNil()` to check if it is null.

func (*DateNullable[T]) Scan

func (c *DateNullable[T]) Scan(row int, dest any) error

func (*DateNullable) SetName

func (c *DateNullable) SetName(v []byte)

SetName set name of the column

func (*DateNullable) SetType

func (c *DateNullable) SetType(v []byte)

SetType set clickhouse type

func (*DateNullable[T]) SetWriteBufferSize

func (c *DateNullable[T]) SetWriteBufferSize(row int)

SetWriteBufferSize set write buffer (number of rows) this buffer only used for writing. By setting this buffer, you will avoid allocating the memory several times.

func (DateNullable[T]) ToJSON

func (c DateNullable[T]) ToJSON(row int, ignoreDoubleQuotes bool, b []byte) []byte

func (*DateNullable) Type

func (c *DateNullable) Type() []byte

Type get clickhouse type

func (*DateNullable[T]) Validate

func (c *DateNullable[T]) Validate(forInsert bool) error

func (*DateNullable[T]) WriteTo

func (c *DateNullable[T]) WriteTo(w io.Writer) (int64, error)

WriteTo write data to ClickHouse. it uses internally

type DateType

type DateType[T types.Date | types.Date32 | types.DateTime | types.DateTime64] interface {
	types.Date | types.Date32 | types.DateTime | types.DateTime64
	ToTime(val *time.Location, precision int) time.Time
	Append(b []byte, val *time.Location, precision int) []byte
	FromTime(val time.Time, precision int) T
}

type ErrInvalidType

type ErrInvalidType struct {
	// contains filtered or unexported fields
}

func (ErrInvalidType) Error

func (e ErrInvalidType) Error() string

type ErrScanType

type ErrScanType struct {
	// contains filtered or unexported fields
}

func (ErrScanType) Error

func (e ErrScanType) Error() string

type LowCardinality

type LowCardinality[T comparable] struct {
	// contains filtered or unexported fields
}

LowCardinality use for LowCardinality ClickHouse DataTypes

func NewLC

func NewLC[T comparable](dictColumn Column[T]) *LowCardinality[T]

NewLC return new LC for LowCardinality ClickHouse DataTypes

func NewLowCardinality

func NewLowCardinality[T comparable](dictColumn Column[T]) *LowCardinality[T]

NewLowCardinality return new LC for LowCardinality ClickHouse DataTypes

func (*LowCardinality[T]) Append

func (c *LowCardinality[T]) Append(v T)

Append value for insert

func (*LowCardinality[T]) AppendAny

func (c *LowCardinality[T]) AppendAny(value any) error

func (*LowCardinality) AppendErr

func (c *LowCardinality) AppendErr() error

func (*LowCardinality[T]) AppendMulti

func (c *LowCardinality[T]) AppendMulti(v ...T)

AppendMulti value for insert

func (*LowCardinality[T]) Array

func (c *LowCardinality[T]) Array() *Array[T]

Array return a Array type for this column

func (*LowCardinality[T]) Data

func (c *LowCardinality[T]) Data() []T

Data get all the data in current block as a slice.

NOTE: the return slice only valid in current block, if you want to use it after, you should copy it. or use Read

func (*LowCardinality[T]) Dicts

func (c *LowCardinality[T]) Dicts() []T

Dicts get dictionary data each key is an index of the dictionary

func (*LowCardinality[T]) FullType

func (c *LowCardinality[T]) FullType() string

func (*LowCardinality[T]) HeaderReader

func (c *LowCardinality[T]) HeaderReader(r *readerwriter.Reader, readColumn bool, revision uint64) error

HeaderReader writes header data to writer it uses internally

func (*LowCardinality[T]) HeaderWriter

func (c *LowCardinality[T]) HeaderWriter(w *readerwriter.Writer)

HeaderWriter reader header data it uses internally

func (*LowCardinality[T]) Keys

func (c *LowCardinality[T]) Keys() []int

Keys get keys of data each key is an index of the dictionary

func (*LowCardinality) Name

func (c *LowCardinality) Name() []byte

Name get name of the column

func (*LowCardinality[T]) Nullable

func (c *LowCardinality[T]) Nullable() *LowCardinalityNullable[T]

Nullable return a Nullable type for this column

func (*LowCardinality[T]) NumRow

func (c *LowCardinality[T]) NumRow() int

NumRow return number of row for this block

func (*LowCardinality[T]) Read

func (c *LowCardinality[T]) Read(value []T) []T

Read reads all the data in current block and append to the input.

func (*LowCardinality[T]) ReadRaw

func (c *LowCardinality[T]) ReadRaw(num int, r *readerwriter.Reader) error

ReadRaw read raw data from the reader. it runs automatically

func (*LowCardinality[T]) Remove

func (c *LowCardinality[T]) Remove(n int)

Remove inserted value from index

its equal to data = data[:n]

func (*LowCardinality[T]) Reset

func (c *LowCardinality[T]) Reset()

Reset all statuses and buffered data

After each reading, the reading data does not need to be reset. It will be automatically reset.

When inserting, buffers are reset only after the operation is successful. If an error occurs, you can safely call insert again.

func (*LowCardinality[T]) Row

func (c *LowCardinality[T]) Row(row int) T

Row return the value of given row. NOTE: Row number start from zero

func (*LowCardinality[T]) RowAny

func (c *LowCardinality[T]) RowAny(row int) any

RowAny return the value of given row. NOTE: Row number start from zero

func (*LowCardinality[T]) Scan

func (c *LowCardinality[T]) Scan(row int, dest any) error

func (*LowCardinality) SetName

func (c *LowCardinality) SetName(v []byte)

SetName set name of the column

func (*LowCardinality) SetType

func (c *LowCardinality) SetType(v []byte)

SetType set clickhouse type

func (*LowCardinality[T]) SetWriteBufferSize

func (c *LowCardinality[T]) SetWriteBufferSize(row int)

SetWriteBufferSize set write buffer (number of rows) this buffer only used for writing. By setting this buffer, you will avoid allocating the memory several times.

func (*LowCardinality[T]) ToJSON

func (c *LowCardinality[T]) ToJSON(row int, ignoreDoubleQuotes bool, b []byte) []byte

func (*LowCardinality) Type

func (c *LowCardinality) Type() []byte

Type get clickhouse type

func (*LowCardinality[T]) Validate

func (c *LowCardinality[T]) Validate(forInsert bool) error

func (*LowCardinality[T]) WriteTo

func (c *LowCardinality[T]) WriteTo(w io.Writer) (int64, error)

WriteTo write data to ClickHouse. it uses internally

type LowCardinalityNullable

type LowCardinalityNullable[T comparable] struct {
	LowCardinality[T]
}

LowCardinalityNullable for LowCardinality(Nullable(T)) ClickHouse DataTypes

func NewLCNullable

func NewLCNullable[T comparable](dictColumn Column[T]) *LowCardinalityNullable[T]

NewLCNullable return new LowCardinalityNullable for nullable LowCardinality ClickHouse DataTypes

func NewLowCardinalityNullable

func NewLowCardinalityNullable[T comparable](dictColumn Column[T]) *LowCardinalityNullable[T]

NewLowCardinalityNullable return new LowCardinalityNullable for nullable LowCardinality ClickHouse DataTypes

func (*LowCardinalityNullable[T]) Append

func (c *LowCardinalityNullable[T]) Append(v T)

Append value for insert

func (*LowCardinalityNullable[T]) AppendAny

func (c *LowCardinalityNullable[T]) AppendAny(value any) error

func (*LowCardinalityNullable) AppendErr

func (c *LowCardinalityNullable) AppendErr() error

func (*LowCardinalityNullable[T]) AppendMulti

func (c *LowCardinalityNullable[T]) AppendMulti(v ...T)

AppendMulti value for insert

func (*LowCardinalityNullable[T]) AppendMultiP

func (c *LowCardinalityNullable[T]) AppendMultiP(v ...*T)

AppendMultiP nullable value for insert

as an alternative (for better performance), you can use `Append` and `AppendNil` to insert a value

func (*LowCardinalityNullable[T]) AppendNil

func (c *LowCardinalityNullable[T]) AppendNil()

Append nil value for insert

func (*LowCardinalityNullable[T]) AppendP

func (c *LowCardinalityNullable[T]) AppendP(v *T)

AppendP nullable value for insert

as an alternative (for better performance), you can use `Append` and `AppendNil` to insert a value

func (*LowCardinalityNullable[T]) Array

func (c *LowCardinalityNullable[T]) Array() *ArrayNullable[T]

Array return a Array type for this column

func (*LowCardinalityNullable[T]) DataP

func (c *LowCardinalityNullable[T]) DataP() []*T

Data get all nullable data in current block as a slice.

NOTE: the return slice only valid in current block, if you want to use it after, you should copy it. or use Read

func (*LowCardinalityNullable) Name

func (c *LowCardinalityNullable) Name() []byte

Name get name of the column

func (*LowCardinalityNullable[T]) ReadP

func (c *LowCardinalityNullable[T]) ReadP(value []*T) []*T

Read reads all nullable data in current block and append to the input.

func (*LowCardinalityNullable[T]) Reset

func (c *LowCardinalityNullable[T]) Reset()

Reset all statuses and buffered data

After each reading, the reading data does not need to be reset. It will be automatically reset.

When inserting, buffers are reset only after the operation is successful. If an error occurs, you can safely call insert again.

func (*LowCardinalityNullable[T]) RowAny

func (c *LowCardinalityNullable[T]) RowAny(row int) any

RowAny return the value of given row. NOTE: Row number start from zero

func (*LowCardinalityNullable[T]) RowIsNil

func (c *LowCardinalityNullable[T]) RowIsNil(row int) bool

RowIsNil return true if value of given row is null NOTE: Row number start from zero

func (*LowCardinalityNullable[T]) RowP

func (c *LowCardinalityNullable[T]) RowP(row int) *T

Row return nullable value of given row NOTE: Row number start from zero

func (*LowCardinalityNullable[T]) Scan

func (c *LowCardinalityNullable[T]) Scan(row int, dest any) error

func (*LowCardinalityNullable) SetName

func (c *LowCardinalityNullable) SetName(v []byte)

SetName set name of the column

func (*LowCardinalityNullable) SetType

func (c *LowCardinalityNullable) SetType(v []byte)

SetType set clickhouse type

func (*LowCardinalityNullable[T]) ToJSON

func (c *LowCardinalityNullable[T]) ToJSON(row int, ignoreDoubleQuotes bool, b []byte) []byte

func (*LowCardinalityNullable) Type

func (c *LowCardinalityNullable) Type() []byte

Type get clickhouse type

type Map

type Map[K comparable, V any] struct {
	MapBase
	// contains filtered or unexported fields
}

Map is a column of Map(K,V) ClickHouse data type Map in clickhouse actually is a array of pair(K,V)

func NewMap

func NewMap[K comparable, V any](
	keyColumn Column[K],
	valueColumn Column[V],
) *Map[K, V]

NewMap create a new map column of Map(K,V) ClickHouse data type

func (*Map[K, V]) Append

func (c *Map[K, V]) Append(v map[K]V)

Append value for insert

func (*Map[K, V]) AppendAny

func (c *Map[K, V]) AppendAny(value any) error

func (*Map) AppendErr

func (c *Map) AppendErr() error

func (*Map[K, V]) AppendMulti

func (c *Map[K, V]) AppendMulti(val ...map[K]V)

AppendMulti value for insert

func (*Map[K, V]) Array

func (c *Map[K, V]) Array() *Array[map[K]V]

Array return a Array type for this column

func (*Map[K, V]) Data

func (c *Map[K, V]) Data() []map[K]V

Data get all the data in current block as a slice.

func (*Map[K, V]) KeyColumn

func (c *Map[K, V]) KeyColumn() Column[K]

KeyColumn return the key column

func (*Map) Name

func (c *Map) Name() []byte

Name get name of the column

func (*Map[K, V]) Read

func (c *Map[K, V]) Read(value []map[K]V) []map[K]V

Read reads all the data in current block and append to the input.

func (*Map[K, V]) Row

func (c *Map[K, V]) Row(row int) map[K]V

Row return the value of given row. NOTE: Row number start from zero

func (*Map[K, V]) RowAny

func (c *Map[K, V]) RowAny(row int) any

RowAny return the value of given row. NOTE: Row number start from zero

func (*Map[K, V]) Scan

func (c *Map[K, V]) Scan(row int, dest any) error

func (*Map) SetName

func (c *Map) SetName(v []byte)

SetName set name of the column

func (*Map) SetType

func (c *Map) SetType(v []byte)

SetType set clickhouse type

func (*Map) Type

func (c *Map) Type() []byte

Type get clickhouse type

func (*Map[K, V]) ValueColumn

func (c *Map[K, V]) ValueColumn() Column[V]

ValueColumn return the value column

type MapBase

type MapBase struct {
	// contains filtered or unexported fields
}

Map is a column of Map(K,V) ClickHouse data type Map in clickhouse actually is a array of pair(K,V)

MapBase is a base class for map and also for non generic of map to use dynamic select column

func NewMapBase

func NewMapBase(
	keyColumn, valueColumn ColumnBasic,
) *MapBase

NewMapBase create a new map column of Map(K,V) ClickHouse data type

func (*MapBase) AppendAny

func (c *MapBase) AppendAny(value any) error

func (*MapBase) AppendErr

func (c *MapBase) AppendErr() error

func (*MapBase) AppendLen

func (c *MapBase) AppendLen(v int)

AppendLen Append len for insert

func (*MapBase) Each

func (c *MapBase) Each(f func(start, end uint64) bool)

Each run the given function for each row in the column with start and end offsets.

in some cases like Map(K,Array(Nullable)) you can't read the data with generic for this situations. you can use this function.

For example colNullableArrayReadKey := colNullableArrayRead.KeyColumn().Data() colNullableArrayReadValue := colNullableArrayRead.ValueColumn().(*column.ArrayNullable[V]).DataP()

colNullableArrayRead.Each(func(start, end uint64) bool {
		val := make(map[string][]*V)
		for ki, key := range colNullableArrayReadKey[start:end] {
			val[key] = colNullableArrayReadValue[start:end][ki]
		}
		colArrayNullableData = append(colArrayNullableData, val)
		return true
	})

func (*MapBase) FullType

func (c *MapBase) FullType() string

func (*MapBase) HeaderReader

func (c *MapBase) HeaderReader(r *readerwriter.Reader, readColumn bool, revision uint64) error

HeaderReader reads header data from reader it uses internally

func (*MapBase) HeaderWriter

func (c *MapBase) HeaderWriter(w *readerwriter.Writer)

HeaderWriter writes header data to writer it uses internally

func (*MapBase) KeyColumn

func (c *MapBase) KeyColumn() ColumnBasic

KeyColumn return the key column

func (*MapBase) Name

func (c *MapBase) Name() []byte

Name get name of the column

func (*MapBase) NumRow

func (c *MapBase) NumRow() int

NumRow return number of row for this block

func (*MapBase) Offsets

func (c *MapBase) Offsets() []uint64

Offsets return all the offsets in current block

func (*MapBase) ReadRaw

func (c *MapBase) ReadRaw(num int, r *readerwriter.Reader) error

ReadRaw read raw data from the reader. it runs automatically

func (*MapBase) Remove

func (c *MapBase) Remove(n int)

Remove inserted value from index

its equal to data = data[:n]

func (*MapBase) Reset

func (c *MapBase) Reset()

Reset all statuses and buffered data

After each reading, the reading data does not need to be reset. It will be automatically reset.

When inserting, buffers are reset only after the operation is successful. If an error occurs, you can safely call insert again.

func (*MapBase) RowAny

func (c *MapBase) RowAny(row int) any

func (*MapBase) Scan

func (c *MapBase) Scan(row int, dest any) error

func (*MapBase) ScanValue

func (c *MapBase) ScanValue(row int, dest reflect.Value) error

func (*MapBase) SetName

func (c *MapBase) SetName(v []byte)

SetName set name of the column

func (*MapBase) SetType

func (c *MapBase) SetType(v []byte)

SetType set clickhouse type

func (*MapBase) SetWriteBufferSize

func (c *MapBase) SetWriteBufferSize(row int)

SetWriteBufferSize set write buffer (number of rows) this buffer only used for writing. By setting this buffer, you will avoid allocating the memory several times.

func (*MapBase) ToJSON

func (c *MapBase) ToJSON(row int, ignoreDoubleQuotes bool, b []byte) []byte

ToJSON

func (*MapBase) TotalRows

func (c *MapBase) TotalRows() int

TotalRows return total rows on this block of array data

func (*MapBase) Type

func (c *MapBase) Type() []byte

Type get clickhouse type

func (*MapBase) Validate

func (c *MapBase) Validate(forInsert bool) error

func (*MapBase) ValueColumn

func (c *MapBase) ValueColumn() ColumnBasic

ValueColumn return the value column

func (*MapBase) WriteTo

func (c *MapBase) WriteTo(w io.Writer) (int64, error)

WriteTo write data to ClickHouse. it uses internally

type MapNullable

type MapNullable[K comparable, V any] struct {
	Map[K, V]
	// contains filtered or unexported fields
}

MapNullable is a column of Map(K,V) ClickHouse data type where V is nullable. Map in clickhouse actually is a array of pair(K,V)

func NewMapNullable

func NewMapNullable[K comparable, V any](
	keyColumn Column[K],
	valueColumn NullableColumn[V],
) *MapNullable[K, V]

NewMapNullable create a new map column of Map(K,V) ClickHouse data type

func (*MapNullable) AppendErr

func (c *MapNullable) AppendErr() error

func (*MapNullable[K, V]) AppendP

func (c *MapNullable[K, V]) AppendP(v map[K]*V)

func (*MapNullable[T, V]) DataP

func (c *MapNullable[T, V]) DataP() []map[T]*V

Data get all the data in current block as a slice.

func (*MapNullable) Name

func (c *MapNullable) Name() []byte

Name get name of the column

func (*MapNullable[T, V]) ReadP

func (c *MapNullable[T, V]) ReadP(value []map[T]*V) []map[T]*V

Read reads all the data in current block and append to column.

func (*MapNullable[K, V]) ReadRaw

func (c *MapNullable[K, V]) ReadRaw(num int, r *readerwriter.Reader) error

ReadRaw read raw data from the reader. it runs automatically

func (*MapNullable[T, V]) RowP

func (c *MapNullable[T, V]) RowP(row int) map[T]*V

Row return the value of given row. NOTE: Row number start from zero

func (*MapNullable) SetName

func (c *MapNullable) SetName(v []byte)

SetName set name of the column

func (*MapNullable) SetType

func (c *MapNullable) SetType(v []byte)

SetType set clickhouse type

func (*MapNullable) Type

func (c *MapNullable) Type() []byte

Type get clickhouse type

func (*MapNullable[K, V]) ValueColumn

func (c *MapNullable[K, V]) ValueColumn() NullableColumn[V]

ValueColumn return the value column

type Nothing

type Nothing struct {
	Base[int8]
}

Nothing represents column of nothing value.

https://clickhouse.com/docs/en/sql-reference/data-types/special-data-types/nothing

func NewNothing

func NewNothing() *Nothing

New create a new column

func (*Nothing) Append

func (c *Nothing) Append(v NothingData)

Append value for insert

Should not use this method. Nothing column is only for select query

func (*Nothing) AppendAny

func (c *Nothing) AppendAny(value any) error

func (*Nothing) AppendErr

func (c *Nothing) AppendErr() error

func (*Nothing) AppendMulti

func (c *Nothing) AppendMulti(v ...NothingData)

AppendMulti value for insert

Should not use this method. Nothing column is only for select query

func (*Nothing) Array

func (c *Nothing) Array() *Array[NothingData]

Array return a Array type for this column

func (*Nothing) Data

func (c *Nothing) Data() []NothingData

Data get all the nullable data in current block as a slice of pointer.

NOTE: it always return slice of nil

func (*Nothing) Elem

func (c *Nothing) Elem(arrayLevel int, nullable bool) ColumnBasic

func (*Nothing) FullType

func (c *Nothing) FullType() string

func (*Nothing) Name

func (c *Nothing) Name() []byte

Name get name of the column

func (*Nothing) Nullable

func (c *Nothing) Nullable() *NothingNullable

Nullable return a nullable type for this column

func (*Nothing) Read

func (c *Nothing) Read(value []NothingData) []NothingData

Read reads all the data in current block and append to the input.

NOTE: it always append values of NothingData

func (*Nothing) Row

func (c *Nothing) Row(i int) NothingData

Append value for insert

func (*Nothing) Scan

func (c *Nothing) Scan(row int, dest any) error

func (*Nothing) SetName

func (c *Nothing) SetName(v []byte)

SetName set name of the column

func (*Nothing) SetType

func (c *Nothing) SetType(v []byte)

SetType set clickhouse type

func (*Nothing) String

func (c *Nothing) String(row int) string

func (*Nothing) ToJSON

func (c *Nothing) ToJSON(row int, ignoreDoubleQuotes bool, b []byte) []byte

func (*Nothing) Type

func (c *Nothing) Type() []byte

Type get clickhouse type

func (*Nothing) Validate

func (c *Nothing) Validate(forInsert bool) error

type NothingData

type NothingData struct{}

type NothingNullable

type NothingNullable struct {
	// contains filtered or unexported fields
}

NothingNullable is a column of Nullable(Nothing) ClickHouse data type

func NewNothingNullable

func NewNothingNullable(dataColumn *Nothing) *NothingNullable

NewNothingNullable return new NothingNullable for Nullable(Nothing) ClickHouse DataType

func (*NothingNullable) Append

func (c *NothingNullable) Append(v NothingData)

Append value for insert

Should not use this method. NothingNullable column is only for select query

func (*NothingNullable) AppendAny

func (c *NothingNullable) AppendAny(value any) error

func (*NothingNullable) AppendErr

func (c *NothingNullable) AppendErr() error

func (*NothingNullable) AppendMulti

func (c *NothingNullable) AppendMulti(v ...NothingData)

AppendMulti value for insert

Should not use this method. NothingNullable column is only for select query

func (*NothingNullable) AppendMultiP

func (c *NothingNullable) AppendMultiP(v ...*NothingData)

AppendMultiP nullable value for insert

as an alternative (for better performance), you can use `Append` and `AppendNil` to insert a value

Should not use this method. NothingNullable column is only for select query

func (*NothingNullable) AppendNil

func (c *NothingNullable) AppendNil()

Append nil value for insert

Should not use this method. NothingNullable column is only for select query

func (*NothingNullable) AppendP

func (c *NothingNullable) AppendP(v *NothingData)

AppendP nullable value for insert

as an alternative (for better performance), you can use `Append` and `AppendNil` to insert a value

Should not use this method. NothingNullable column is only for select query

func (*NothingNullable) Array

Array return a Array type for this column

func (*NothingNullable) Data

func (c *NothingNullable) Data() []NothingData

Data get all the data in current block as a slice.

NOTE: it always return slice of zero value of NothingData

func (*NothingNullable) DataNil

func (c *NothingNullable) DataNil() []bool

DataNil get all nil state in this block

func (*NothingNullable) DataP

func (c *NothingNullable) DataP() []*NothingData

Data get all the nullable data in current block as a slice of pointer.

NOTE: it always return slice of nil

func (*NothingNullable) FullType

func (c *NothingNullable) FullType() string

func (*NothingNullable) HeaderReader

func (c *NothingNullable) HeaderReader(r *readerwriter.Reader, readColumn bool, revision uint64) error

HeaderReader reads header data from reader it uses internally

func (*NothingNullable) HeaderWriter

func (c *NothingNullable) HeaderWriter(w *readerwriter.Writer)

HeaderWriter writes header data to writer it uses internally

func (*NothingNullable) Name

func (c *NothingNullable) Name() []byte

Name get name of the column

func (*NothingNullable) NumRow

func (c *NothingNullable) NumRow() int

NumRow return number of row for this block

func (*NothingNullable) Read

func (c *NothingNullable) Read(value []NothingData) []NothingData

Read reads all the data in current block and append to the input.

NOTE: it always append zero value of NothingData

func (*NothingNullable) ReadNil

func (c *NothingNullable) ReadNil(value []bool) []bool

ReadAll read all nils state in this block and append to the input

func (*NothingNullable) ReadP

func (c *NothingNullable) ReadP(value []*NothingData) []*NothingData

ReadP read all value in this block and append to the input slice (for nullable data)

As an alternative (for better performance), You can use `Read` and one of `RowIsNil` and `ReadNil` and `DataNil` to detect if value is null or not.

func (*NothingNullable) ReadRaw

func (c *NothingNullable) ReadRaw(num int, r *readerwriter.Reader) error

ReadRaw read raw data from the reader. it runs automatically

func (*NothingNullable) Remove

func (c *NothingNullable) Remove(n int)

Remove inserted value from index

its equal to data = data[:n]

func (*NothingNullable) Reset

func (c *NothingNullable) Reset()

Reset all statuses and buffered data

After each reading, the reading data does not need to be reset. It will be automatically reset.

When inserting, buffers are reset only after the operation is successful. If an error occurs, you can safely call insert again.

func (*NothingNullable) Row

func (c *NothingNullable) Row(i int) NothingData

Append value for insert

func (*NothingNullable) RowAny

func (c *NothingNullable) RowAny(i int) any

Append value for insert

func (*NothingNullable) RowIsNil

func (c *NothingNullable) RowIsNil(row int) bool

RowIsNil return true if the row is null

func (*NothingNullable) RowP

func (c *NothingNullable) RowP(row int) *NothingData

RowP return the value of given row for nullable data

NOTE: Row number start from zero

NOTE: it always return nil

func (*NothingNullable) Scan

func (c *NothingNullable) Scan(row int, dest any) error

func (*NothingNullable) SetName

func (c *NothingNullable) SetName(v []byte)

SetName set name of the column

func (*NothingNullable) SetType

func (c *NothingNullable) SetType(v []byte)

SetType set clickhouse type

func (*NothingNullable) SetWriteBufferSize

func (c *NothingNullable) SetWriteBufferSize(row int)

SetWriteBufferSize set write buffer (number of rows)

NOTE: Should not use this method. NothingNullable column is only for select query

func (*NothingNullable) ToJSON

func (c *NothingNullable) ToJSON(row int, ignoreDoubleQuotes bool, b []byte) []byte

func (*NothingNullable) Type

func (c *NothingNullable) Type() []byte

Type get clickhouse type

func (*NothingNullable) Validate

func (c *NothingNullable) Validate(forInsert bool) error

func (*NothingNullable) WriteTo

func (c *NothingNullable) WriteTo(w io.Writer) (int64, error)

WriteTo write data to ClickHouse. it uses internally

type NullableColumn

type NullableColumn[T any] interface {
	Column[T]
	DataP() []*T
	ReadP([]*T) []*T
	RowP(int) *T
	AppendP(*T)
	AppendMultiP(...*T)
	RowIsNil(row int) bool
}

type String

type String struct {
	StringBase[string]
}

String is a column of String ClickHouse data type

func NewString

func NewString() *String

NewString is a column of String ClickHouse data type

func (*String) AppendErr

func (c *String) AppendErr() error

func (*String) Elem

func (c *String) Elem(arrayLevel int, nullable, lc bool) ColumnBasic

func (*String) Name

func (c *String) Name() []byte

Name get name of the column

func (*String) SetName

func (c *String) SetName(v []byte)

SetName set name of the column

func (*String) SetType

func (c *String) SetType(v []byte)

SetType set clickhouse type

func (*String) Type

func (c *String) Type() []byte

Type get clickhouse type

type StringBase

type StringBase[T ~string] struct {
	// contains filtered or unexported fields
}

StringBase is a column of String ClickHouse data type with generic type

func NewStringBase

func NewStringBase[T ~string]() *StringBase[T]

NewString is a column of String ClickHouse data type with generic type

func (*StringBase[T]) Append

func (c *StringBase[T]) Append(v T)

Append value for insert

func (*StringBase[T]) AppendAny

func (c *StringBase[T]) AppendAny(value any) error

func (*StringBase[T]) AppendBytes

func (c *StringBase[T]) AppendBytes(v []byte)

AppendBytes value of bytes for insert

func (*StringBase[T]) AppendBytesMulti

func (c *StringBase[T]) AppendBytesMulti(v ...[]byte)

AppendBytesMulti value of bytes for insert

func (*StringBase) AppendErr

func (c *StringBase) AppendErr() error

func (*StringBase[T]) AppendMulti

func (c *StringBase[T]) AppendMulti(v ...T)

AppendMulti value for insert

func (*StringBase[T]) Array

func (c *StringBase[T]) Array() *Array[T]

Array return a Array type for this column

func (*StringBase[T]) Data

func (c *StringBase[T]) Data() []T

Data get all the data in current block as a slice.

func (*StringBase[T]) DataBytes

func (c *StringBase[T]) DataBytes() [][]byte

Data get all the data in current block as a slice of []byte.

func (*StringBase[T]) Each

func (c *StringBase[T]) Each(f func(i int, b []byte) bool)

func (*StringBase[T]) Elem

func (c *StringBase[T]) Elem(arrayLevel int, nullable, lc bool) ColumnBasic

func (*StringBase[T]) FullType

func (c *StringBase[T]) FullType() string

func (*StringBase[T]) HeaderReader

func (c *StringBase[T]) HeaderReader(r *readerwriter.Reader, readColumn bool, revision uint64) error

HeaderReader reads header data from read it uses internally

func (*StringBase[T]) HeaderWriter

func (c *StringBase[T]) HeaderWriter(w *readerwriter.Writer)

HeaderWriter writes header data to writer it uses internally

func (*StringBase[T]) LC

func (c *StringBase[T]) LC() *LowCardinality[T]

LC return a low cardinality type for this column

func (*StringBase[T]) LowCardinality

func (c *StringBase[T]) LowCardinality() *LowCardinality[T]

LowCardinality return a low cardinality type for this column

func (*StringBase) Name

func (c *StringBase) Name() []byte

Name get name of the column

func (*StringBase[T]) Nullable

func (c *StringBase[T]) Nullable() *StringNullable[T]

Nullable return a nullable type for this column

func (*StringBase[T]) NumRow

func (c *StringBase[T]) NumRow() int

NumRow return number of row for this block

func (*StringBase[T]) Read

func (c *StringBase[T]) Read(value []T) []T

Read reads all the data in current block and append to the input.

func (*StringBase[T]) ReadBytes

func (c *StringBase[T]) ReadBytes(value [][]byte) [][]byte

Read reads all the data as `[]byte` in current block and append to the input.

data is valid only in the current block.

func (*StringBase[T]) ReadRaw

func (c *StringBase[T]) ReadRaw(num int, r *readerwriter.Reader) error

ReadRaw read raw data from the reader. it runs automatically when you call `ReadColumns()`

func (*StringBase[T]) Remove

func (c *StringBase[T]) Remove(n int)

Remove inserted value from index

its equal to data = data[:n]

func (*StringBase[T]) Reset

func (c *StringBase[T]) Reset()

Reset all status and buffer data

Reading data does not require a reset after each read. The reset will be triggered automatically.

However, writing data requires a reset after each write.

func (*StringBase[T]) Row

func (c *StringBase[T]) Row(row int) T

Row return the value of given row.

NOTE: Row number start from zero

func (*StringBase[T]) RowAny

func (c *StringBase[T]) RowAny(row int) any

RowAny return the value of given row. NOTE: Row number start from zero

func (*StringBase[T]) RowBytes

func (c *StringBase[T]) RowBytes(row int) []byte

Row return the value of given row.

Data is valid only in the current block.

func (*StringBase[T]) Scan

func (c *StringBase[T]) Scan(row int, dest any) error

func (*StringBase[T]) ScanValue

func (c *StringBase[T]) ScanValue(row int, value reflect.Value) error

func (*StringBase) SetName

func (c *StringBase) SetName(v []byte)

SetName set name of the column

func (*StringBase) SetType

func (c *StringBase) SetType(v []byte)

SetType set clickhouse type

func (*StringBase[T]) SetWriteBufferSize

func (c *StringBase[T]) SetWriteBufferSize(b int)

SetWriteBufferSize set write buffer (number of bytes) this buffer only used for writing. By setting this buffer, you will avoid allocating the memory several times.

func (*StringBase[T]) ToJSON

func (c *StringBase[T]) ToJSON(row int, ignoreDoubleQuotes bool, b []byte) []byte

ToJSON

func (*StringBase) Type

func (c *StringBase) Type() []byte

Type get clickhouse type

func (*StringBase[T]) Validate

func (c *StringBase[T]) Validate(forInsert bool) error

func (*StringBase[T]) WriteTo

func (c *StringBase[T]) WriteTo(w io.Writer) (int64, error)

WriteTo write data to ClickHouse. it uses internally

type StringNullable

type StringNullable[T ~string] struct {
	// contains filtered or unexported fields
}

StringNullable is a column of Nullable(T) ClickHouse data type

func NewStringNullable

func NewStringNullable[T ~string](dataColumn *StringBase[T]) *StringNullable[T]

NewStringNullable return new StringNullable for StringNullable(T) ClickHouse DataType

func (*StringNullable[T]) Append

func (c *StringNullable[T]) Append(v T)

Append value for insert

func (*StringNullable[T]) AppendAny

func (c *StringNullable[T]) AppendAny(value any) error

func (*StringNullable[T]) AppendBytes

func (c *StringNullable[T]) AppendBytes(v []byte)

Append value for insert

func (*StringNullable[T]) AppendBytesMulti

func (c *StringNullable[T]) AppendBytesMulti(v ...[]byte)

Append value for insert

func (*StringNullable) AppendErr

func (c *StringNullable) AppendErr() error

func (*StringNullable[T]) AppendMulti

func (c *StringNullable[T]) AppendMulti(v ...T)

Append value for insert

func (*StringNullable[T]) AppendMultiP

func (c *StringNullable[T]) AppendMultiP(v ...*T)

AppendMultiP nullable value for insert

as an alternative (for better performance), you can use `Append` and `AppendNil` to insert a value

func (*StringNullable[T]) AppendNil

func (c *StringNullable[T]) AppendNil()

Append nil value for insert

func (*StringNullable[T]) AppendP

func (c *StringNullable[T]) AppendP(v *T)

AppendP nullable value for insert

as an alternative (for better performance), you can use `Append` and `AppendNil` to insert a value

func (*StringNullable[T]) Array

func (c *StringNullable[T]) Array() *ArrayNullable[T]

Array return a Array type for this column

func (*StringNullable[T]) Data

func (c *StringNullable[T]) Data() []T

Data get all the data in current block as a slice.

NOTE: the return slice only valid in current block, if you want to use it after, you should copy it. or use Read

func (*StringNullable[T]) DataNil

func (c *StringNullable[T]) DataNil() []bool

DataNil get all nil state in this block

func (*StringNullable[T]) DataP

func (c *StringNullable[T]) DataP() []*T

Data get all the nullable data in current block as a slice of pointer.

As an alternative (for better performance). You can use `Data` and one of `RowIsNil` and `ReadNil` and `DataNil` to detect if value is null or not.

func (*StringNullable[T]) FullType

func (c *StringNullable[T]) FullType() string

func (*StringNullable[T]) HeaderReader

func (c *StringNullable[T]) HeaderReader(r *readerwriter.Reader, readColumn bool, revision uint64) error

HeaderReader reads header data from reader it uses internally

func (*StringNullable[T]) HeaderWriter

func (c *StringNullable[T]) HeaderWriter(w *readerwriter.Writer)

HeaderWriter writes header data to writer it uses internally

func (*StringNullable) Name

func (c *StringNullable) Name() []byte

Name get name of the column

func (*StringNullable[T]) NumRow

func (c *StringNullable[T]) NumRow() int

NumRow return number of row for this block

func (*StringNullable[T]) Read

func (c *StringNullable[T]) Read(value []T) []T

Read reads all the data in current block and append to the input.

func (*StringNullable[T]) ReadNil

func (c *StringNullable[T]) ReadNil(value []bool) []bool

ReadAll read all nils state in this block and append to the input

func (*StringNullable[T]) ReadP

func (c *StringNullable[T]) ReadP(value []*T) []*T

ReadP read all value in this block and append to the input slice (for nullable data)

As an alternative (for better performance), You can use `Read` and one of `RowIsNil` and `ReadNil` and `DataNil` to detect if value is null or not.

func (*StringNullable[T]) ReadRaw

func (c *StringNullable[T]) ReadRaw(num int, r *readerwriter.Reader) error

ReadRaw read raw data from the reader. it runs automatically

func (*StringNullable[T]) Remove

func (c *StringNullable[T]) Remove(n int)

Remove inserted value from index

its equal to data = data[:n]

func (*StringNullable[T]) Reset

func (c *StringNullable[T]) Reset()

Reset all statuses and buffered data

After each reading, the reading data does not need to be reset. It will be automatically reset.

When inserting, buffers are reset only after the operation is successful. If an error occurs, you can safely call insert again.

func (*StringNullable[T]) Row

func (c *StringNullable[T]) Row(i int) T

Row return the value of given row

func (*StringNullable[T]) RowAny

func (c *StringNullable[T]) RowAny(i int) any

RowAny return the value of given row

func (*StringNullable[T]) RowBytes

func (c *StringNullable[T]) RowBytes(i int) []byte

Row return the value of given row as bytes

func (*StringNullable[T]) RowIsNil

func (c *StringNullable[T]) RowIsNil(row int) bool

RowIsNil return true if the row is null

func (*StringNullable[T]) RowP

func (c *StringNullable[T]) RowP(row int) *T

RowP return the value of given row for nullable data NOTE: Row number start from zero

As an alternative (for better performance), you can use `Row()` to get a value and `RowIsNil()` to check if it is null.

func (*StringNullable[T]) Scan

func (c *StringNullable[T]) Scan(row int, dest any) error

func (*StringNullable) SetName

func (c *StringNullable) SetName(v []byte)

SetName set name of the column

func (*StringNullable) SetType

func (c *StringNullable) SetType(v []byte)

SetType set clickhouse type

func (*StringNullable[T]) SetWriteBufferSize

func (c *StringNullable[T]) SetWriteBufferSize(row int)

SetWriteBufferSize set write buffer (number of rows) this buffer only used for writing. By setting this buffer, you will avoid allocating the memory several times.

func (*StringNullable[T]) ToJSON

func (c *StringNullable[T]) ToJSON(row int, ignoreDoubleQuotes bool, b []byte) []byte

func (*StringNullable) Type

func (c *StringNullable) Type() []byte

Type get clickhouse type

func (*StringNullable[T]) Validate

func (c *StringNullable[T]) Validate(forInsert bool) error

func (*StringNullable[T]) WriteTo

func (c *StringNullable[T]) WriteTo(w io.Writer) (int64, error)

WriteTo write data to ClickHouse. it uses internally

type Tuple

type Tuple struct {
	// contains filtered or unexported fields
}

Tuple is a column of Tuple(T1,T2,.....,Tn) ClickHouse data type

this is actually a group of columns. it doesn't have any method for read or write data

func NewTuple

func NewTuple(columns ...ColumnBasic) *Tuple

NewTuple create a new tuple of Tuple(T1,T2,.....,Tn) ClickHouse data type

this is actually a group of columns. it doesn't have any method for read or write data

func (*Tuple) AppendAny

func (c *Tuple) AppendAny(value any) error

func (*Tuple) AppendErr

func (c *Tuple) AppendErr() error

func (*Tuple) Array

func (c *Tuple) Array() *ArrayBase

Array return a Array type for this column

func (*Tuple) Columns

func (c *Tuple) Columns() []ColumnBasic

Column returns the all sub columns

func (*Tuple) Elem

func (c *Tuple) Elem(arrayLevel int) ColumnBasic

func (*Tuple) FullType

func (c *Tuple) FullType() string

func (*Tuple) HeaderReader

func (c *Tuple) HeaderReader(r *readerwriter.Reader, readColumn bool, revision uint64) error

HeaderReader reads header data from reader. it uses internally

func (*Tuple) HeaderWriter

func (c *Tuple) HeaderWriter(w *readerwriter.Writer)

HeaderWriter writes header data to writer it uses internally

func (*Tuple) Name

func (c *Tuple) Name() []byte

Name get name of the column

func (*Tuple) NumRow

func (c *Tuple) NumRow() int

NumRow return number of row for this block

func (*Tuple) ReadRaw

func (c *Tuple) ReadRaw(num int, r *readerwriter.Reader) error

ReadRaw read raw data from the reader. it runs automatically

func (*Tuple) Remove

func (c *Tuple) Remove(n int)

Remove inserted value from index

its equal to data = data[:n]

func (*Tuple) Reset

func (c *Tuple) Reset()

Reset all statuses and buffered data

After each reading, the reading data does not need to be reset. It will be automatically reset.

When inserting, buffers are reset only after the operation is successful. If an error occurs, you can safely call insert again.

func (*Tuple) Row

func (c *Tuple) Row(row int) any

func (*Tuple) RowAny

func (c *Tuple) RowAny(row int) any

func (*Tuple) Scan

func (c *Tuple) Scan(row int, dest any) error

func (*Tuple) ScanValue

func (c *Tuple) ScanValue(row int, dest reflect.Value) error

func (*Tuple) SetName

func (c *Tuple) SetName(v []byte)

SetName set name of the column

func (*Tuple) SetType

func (c *Tuple) SetType(v []byte)

SetType set clickhouse type

func (*Tuple) SetWriteBufferSize

func (c *Tuple) SetWriteBufferSize(row int)

SetWriteBufferSize set write buffer (number of rows) this buffer only used for writing. By setting this buffer, you will avoid allocating the memory several times.

func (*Tuple) ToJSON

func (c *Tuple) ToJSON(row int, ignoreDoubleQuotes bool, b []byte) []byte

func (*Tuple) Type

func (c *Tuple) Type() []byte

Type get clickhouse type

func (*Tuple) Validate

func (c *Tuple) Validate(forInsert bool) error

func (*Tuple) WriteTo

func (c *Tuple) WriteTo(w io.Writer) (int64, error)

WriteTo write data to ClickHouse. it uses internally

type Tuple1

type Tuple1[T1 any] struct {
	Tuple
	// contains filtered or unexported fields
}

Tuple1 is a column of Tuple(T1) ClickHouse data type

func NewTuple1

func NewTuple1[T1 any](
	column1 Column[T1],
) *Tuple1[T1]

NewTuple1 create a new tuple of Tuple(T1) ClickHouse data type

func (*Tuple1[T]) Append

func (c *Tuple1[T]) Append(v T)

Append value for insert

func (*Tuple1[T]) AppendAny

func (c *Tuple1[T]) AppendAny(value any) error

func (*Tuple1) AppendErr

func (c *Tuple1) AppendErr() error

func (*Tuple1[T]) AppendMulti

func (c *Tuple1[T]) AppendMulti(v ...T)

AppendMulti value for insert

func (*Tuple1[T]) Array

func (c *Tuple1[T]) Array() *Array[T]

Array return a Array type for this column

func (*Tuple1[T]) Data

func (c *Tuple1[T]) Data() []T

Data get all the data in current block as a slice.

func (*Tuple1) Name

func (c *Tuple1) Name() []byte

Name get name of the column

func (*Tuple1[T]) Read

func (c *Tuple1[T]) Read(value []T) []T

Read reads all the data in current block and append to the input.

func (*Tuple1[T]) Row

func (c *Tuple1[T]) Row(row int) T

Row return the value of given row. NOTE: Row number start from zero

func (*Tuple1[T]) RowAny

func (c *Tuple1[T]) RowAny(row int) any

RowAny return the value of given row. NOTE: Row number start from zero

func (*Tuple1) SetName

func (c *Tuple1) SetName(v []byte)

SetName set name of the column

func (*Tuple1) SetType

func (c *Tuple1) SetType(v []byte)

SetType set clickhouse type

func (*Tuple1) Type

func (c *Tuple1) Type() []byte

Type get clickhouse type

type Tuple2

type Tuple2[T ~struct {
	Col1 T1
	Col2 T2
}, T1, T2 any] struct {
	Tuple
	// contains filtered or unexported fields
}

Tuple2 is a column of Tuple(T1, T2) ClickHouse data type

func NewPoint

func NewPoint() *Tuple2[types.Point, float64, float64]

func NewTuple2

func NewTuple2[T ~struct {
	Col1 T1
	Col2 T2
}, T1, T2 any](
	column1 Column[T1],
	column2 Column[T2],
) *Tuple2[T, T1, T2]

NewTuple2 create a new tuple of Tuple(T1, T2) ClickHouse data type

func (*Tuple2[T, T1, T2]) Append

func (c *Tuple2[T, T1, T2]) Append(v T)

Append value for insert

func (*Tuple2[T, T1, T2]) AppendAny

func (c *Tuple2[T, T1, T2]) AppendAny(value any) error

func (*Tuple2) AppendErr

func (c *Tuple2) AppendErr() error

func (*Tuple2[T, T1, T2]) AppendMulti

func (c *Tuple2[T, T1, T2]) AppendMulti(v ...T)

AppendMulti value for insert

func (*Tuple2[T, T1, T2]) Array

func (c *Tuple2[T, T1, T2]) Array() *Array[T]

Array return a Array type for this column

func (*Tuple2[T, T1, T2]) Data

func (c *Tuple2[T, T1, T2]) Data() []T

Data get all the data in current block as a slice.

func (*Tuple2) Name

func (c *Tuple2) Name() []byte

Name get name of the column

func (*Tuple2[T, T1, T2]) Read

func (c *Tuple2[T, T1, T2]) Read(value []T) []T

Read reads all the data in current block and append to the input.

func (*Tuple2[T, T1, T2]) Row

func (c *Tuple2[T, T1, T2]) Row(row int) T

Row return the value of given row. NOTE: Row number start from zero

func (*Tuple2[T, T1, T2]) RowAny

func (c *Tuple2[T, T1, T2]) RowAny(row int) any

RowAny return the value of given row. NOTE: Row number start from zero

func (*Tuple2) SetName

func (c *Tuple2) SetName(v []byte)

SetName set name of the column

func (*Tuple2) SetType

func (c *Tuple2) SetType(v []byte)

SetType set clickhouse type

func (*Tuple2) Type

func (c *Tuple2) Type() []byte

Type get clickhouse type

type Tuple3

type Tuple3[T ~struct {
	Col1 T1
	Col2 T2
	Col3 T3
}, T1, T2, T3 any] struct {
	Tuple
	// contains filtered or unexported fields
}

Tuple3 is a column of Tuple(T1, T2, T3) ClickHouse data type

func NewTuple3

func NewTuple3[T ~struct {
	Col1 T1
	Col2 T2
	Col3 T3
}, T1, T2, T3 any](
	column1 Column[T1],
	column2 Column[T2],
	column3 Column[T3],
) *Tuple3[T, T1, T2, T3]

NewTuple3 create a new tuple of Tuple(T1, T2, T3) ClickHouse data type

func (*Tuple3[T, T1, T2, T3]) Append

func (c *Tuple3[T, T1, T2, T3]) Append(v T)

Append value for insert

func (*Tuple3[T, T1, T2, T3]) AppendAny

func (c *Tuple3[T, T1, T2, T3]) AppendAny(value any) error

func (*Tuple3) AppendErr

func (c *Tuple3) AppendErr() error

func (*Tuple3[T, T1, T2, T3]) AppendMulti

func (c *Tuple3[T, T1, T2, T3]) AppendMulti(v ...T)

AppendMulti value for insert

func (*Tuple3[T, T1, T2, T3]) Array

func (c *Tuple3[T, T1, T2, T3]) Array() *Array[T]

Array return a Array type for this column

func (*Tuple3[T, T1, T2, T3]) Data

func (c *Tuple3[T, T1, T2, T3]) Data() []T

Data get all the data in current block as a slice.

func (*Tuple3) Name

func (c *Tuple3) Name() []byte

Name get name of the column

func (*Tuple3[T, T1, T2, T3]) Read

func (c *Tuple3[T, T1, T2, T3]) Read(value []T) []T

Read reads all the data in current block and append to the input.

func (*Tuple3[T, T1, T2, T3]) Row

func (c *Tuple3[T, T1, T2, T3]) Row(row int) T

Row return the value of given row. NOTE: Row number start from zero

func (*Tuple3[T, T1, T2, T3]) RowAny

func (c *Tuple3[T, T1, T2, T3]) RowAny(row int) any

RowAny return the value of given row. NOTE: Row number start from zero

func (*Tuple3) SetName

func (c *Tuple3) SetName(v []byte)

SetName set name of the column

func (*Tuple3) SetType

func (c *Tuple3) SetType(v []byte)

SetType set clickhouse type

func (*Tuple3) Type

func (c *Tuple3) Type() []byte

Type get clickhouse type

type Tuple4

type Tuple4[T ~struct {
	Col1 T1
	Col2 T2
	Col3 T3
	Col4 T4
}, T1, T2, T3, T4 any] struct {
	Tuple
	// contains filtered or unexported fields
}

Tuple4 is a column of Tuple(T1, T2, T3, T4) ClickHouse data type

func NewTuple4

func NewTuple4[T ~struct {
	Col1 T1
	Col2 T2
	Col3 T3
	Col4 T4
}, T1, T2, T3, T4 any](
	column1 Column[T1],
	column2 Column[T2],
	column3 Column[T3],
	column4 Column[T4],
) *Tuple4[T, T1, T2, T3, T4]

NewTuple4 create a new tuple of Tuple(T1, T2, T3, T4) ClickHouse data type

func (*Tuple4[T, T1, T2, T3, T4]) Append

func (c *Tuple4[T, T1, T2, T3, T4]) Append(v T)

Append value for insert

func (*Tuple4[T, T1, T2, T3, T4]) AppendAny

func (c *Tuple4[T, T1, T2, T3, T4]) AppendAny(value any) error

func (*Tuple4) AppendErr

func (c *Tuple4) AppendErr() error

func (*Tuple4[T, T1, T2, T3, T4]) AppendMulti

func (c *Tuple4[T, T1, T2, T3, T4]) AppendMulti(v ...T)

AppendMulti value for insert

func (*Tuple4[T, T1, T2, T3, T4]) Array

func (c *Tuple4[T, T1, T2, T3, T4]) Array() *Array[T]

Array return a Array type for this column

func (*Tuple4[T, T1, T2, T3, T4]) Data

func (c *Tuple4[T, T1, T2, T3, T4]) Data() []T

Data get all the data in current block as a slice.

func (*Tuple4) Name

func (c *Tuple4) Name() []byte

Name get name of the column

func (*Tuple4[T, T1, T2, T3, T4]) Read

func (c *Tuple4[T, T1, T2, T3, T4]) Read(value []T) []T

Read reads all the data in current block and append to the input.

func (*Tuple4[T, T1, T2, T3, T4]) Row

func (c *Tuple4[T, T1, T2, T3, T4]) Row(row int) T

Row return the value of given row. NOTE: Row number start from zero

func (*Tuple4[T, T1, T2, T3, T4]) RowAny

func (c *Tuple4[T, T1, T2, T3, T4]) RowAny(row int) any

RowAny return the value of given row. NOTE: Row number start from zero

func (*Tuple4) SetName

func (c *Tuple4) SetName(v []byte)

SetName set name of the column

func (*Tuple4) SetType

func (c *Tuple4) SetType(v []byte)

SetType set clickhouse type

func (*Tuple4) Type

func (c *Tuple4) Type() []byte

Type get clickhouse type

type Tuple5

type Tuple5[T ~struct {
	Col1 T1
	Col2 T2
	Col3 T3
	Col4 T4
	Col5 T5
}, T1, T2, T3, T4, T5 any] struct {
	Tuple
	// contains filtered or unexported fields
}

Tuple5 is a column of Tuple(T1, T2, T3, T4, T5) ClickHouse data type

func NewTuple5

func NewTuple5[T ~struct {
	Col1 T1
	Col2 T2
	Col3 T3
	Col4 T4
	Col5 T5
}, T1, T2, T3, T4, T5 any](
	column1 Column[T1],
	column2 Column[T2],
	column3 Column[T3],
	column4 Column[T4],
	column5 Column[T5],
) *Tuple5[T, T1, T2, T3, T4, T5]

NewTuple5 create a new tuple of Tuple(T1, T2, T3, T4, T5) ClickHouse data type

func (*Tuple5[T, T1, T2, T3, T4, T5]) Append

func (c *Tuple5[T, T1, T2, T3, T4, T5]) Append(v T)

Append value for insert

func (*Tuple5[T, T1, T2, T3, T4, T5]) AppendAny

func (c *Tuple5[T, T1, T2, T3, T4, T5]) AppendAny(value any) error

func (*Tuple5) AppendErr

func (c *Tuple5) AppendErr() error

func (*Tuple5[T, T1, T2, T3, T4, T5]) AppendMulti

func (c *Tuple5[T, T1, T2, T3, T4, T5]) AppendMulti(v ...T)

AppendMulti value for insert

func (*Tuple5[T, T1, T2, T3, T4, T5]) Array

func (c *Tuple5[T, T1, T2, T3, T4, T5]) Array() *Array[T]

Array return a Array type for this column

func (*Tuple5[T, T1, T2, T3, T4, T5]) Data

func (c *Tuple5[T, T1, T2, T3, T4, T5]) Data() []T

Data get all the data in current block as a slice.

func (*Tuple5) Name

func (c *Tuple5) Name() []byte

Name get name of the column

func (*Tuple5[T, T1, T2, T3, T4, T5]) Read

func (c *Tuple5[T, T1, T2, T3, T4, T5]) Read(value []T) []T

Read reads all the data in current block and append to the input.

func (*Tuple5[T, T1, T2, T3, T4, T5]) Row

func (c *Tuple5[T, T1, T2, T3, T4, T5]) Row(row int) T

Row return the value of given row. NOTE: Row number start from zero

func (*Tuple5[T, T1, T2, T3, T4, T5]) RowAny

func (c *Tuple5[T, T1, T2, T3, T4, T5]) RowAny(row int) any

RowAny return the value of given row. NOTE: Row number start from zero

func (*Tuple5) SetName

func (c *Tuple5) SetName(v []byte)

SetName set name of the column

func (*Tuple5) SetType

func (c *Tuple5) SetType(v []byte)

SetType set clickhouse type

func (*Tuple5) Type

func (c *Tuple5) Type() []byte

Type get clickhouse type

type TupleStruct

type TupleStruct[T any] interface {
	Column[T]
	Array() *Array[T]
}

type Variant

type Variant struct {
	// contains filtered or unexported fields
}

Variant is a column of Variant(T1,T2,.....,Tn) ClickHouse data type

func NewVariant

func NewVariant(columns ...ColumnBasic) *Variant

NewVariant create a new Variant of Variant(T1,T2,.....,Tn) ClickHouse data type

func (*Variant) Append

func (c *Variant) Append(v any)

Append append value to the column

func (*Variant) AppendAny

func (c *Variant) AppendAny(value any) error

func (*Variant) AppendDiscriminators

func (c *Variant) AppendDiscriminators(discriminators uint8)

AppendDiscriminators append discriminators to the column you can get use column.LocationInParent to get the index of the column

func (*Variant) AppendDiscriminatorsMulti

func (c *Variant) AppendDiscriminatorsMulti(discriminators ...uint8)

AppendDiscriminatorsMulti append multiple discriminators to the column

func (*Variant) AppendErr

func (c *Variant) AppendErr() error

func (*Variant) AppendMulti

func (c *Variant) AppendMulti(v ...any)

AppendMulti append multiple value to the column

func (*Variant) AppendNil

func (c *Variant) AppendNil()

AppendNil append nil to the column

func (*Variant) Array

func (c *Variant) Array() *Array[any]

Array return a Array type for this column

func (*Variant) Columns

func (c *Variant) Columns() []ColumnBasic

Column returns the all sub columns

func (*Variant) Data

func (c *Variant) Data() []any

Data get all the data in current block as a slice.

func (*Variant) Elem

func (c *Variant) Elem(arrayLevel int) ColumnBasic

func (*Variant) FullType

func (c *Variant) FullType() string

func (*Variant) HeaderReader

func (c *Variant) HeaderReader(r *readerwriter.Reader, readColumn bool, revision uint64) error

HeaderReader reads header data from reader. it uses internally

func (*Variant) HeaderWriter

func (c *Variant) HeaderWriter(w *readerwriter.Writer)

HeaderWriter writes header data to writer it uses internally

func (*Variant) Name

func (c *Variant) Name() []byte

Name get name of the column

func (*Variant) NumRow

func (c *Variant) NumRow() int

NumRow return number of row for this block

func (*Variant) Read

func (c *Variant) Read(value []any) []any

Read reads all the data in current block and append to the input.

func (*Variant) ReadRaw

func (c *Variant) ReadRaw(num int, r *readerwriter.Reader) error

ReadRaw read raw data from the reader. it runs automatically

func (*Variant) Remove

func (c *Variant) Remove(n int)

Remove inserted value from index

its equal to data = data[:n]

func (*Variant) Reset

func (c *Variant) Reset()

Reset all statuses and buffered data

After each reading, the reading data does not need to be reset. It will be automatically reset.

When inserting, buffers are reset only after the operation is successful. If an error occurs, you can safely call insert again.

func (*Variant) Row

func (c *Variant) Row(row int) any

Row return the value of given row

func (*Variant) RowAny

func (c *Variant) RowAny(row int) any

RowAny return the value of given row as any.

func (*Variant) RowIsNil

func (c *Variant) RowIsNil(row int) bool

RowIsNil returns true if the row is nil

func (*Variant) RowPos

func (c *Variant) RowPos(row int) (columnIndex uint8, columnRow int)

RowPos returns the column index and row index of the given row

func (*Variant) Scan

func (c *Variant) Scan(row int, dest any) error

Scan scan value from column to dest

func (*Variant) SetName

func (c *Variant) SetName(v []byte)

SetName set name of the column

func (*Variant) SetType

func (c *Variant) SetType(v []byte)

SetType set clickhouse type

func (*Variant) SetWriteBufferSize

func (c *Variant) SetWriteBufferSize(row int)

SetWriteBufferSize set write buffer (number of rows) this buffer only used for writing. By setting this buffer, you will avoid allocating the memory several times.

func (*Variant) ToJSON

func (c *Variant) ToJSON(row int, ignoreDoubleQuotes bool, b []byte) []byte

func (*Variant) Type

func (c *Variant) Type() []byte

Type get clickhouse type

func (*Variant) Validate

func (c *Variant) Validate(forInsert bool) error

Validate is validate the column for insert and select. it uses internally

func (*Variant) WriteTo

func (c *Variant) WriteTo(w io.Writer) (int64, error)

WriteTo write data to ClickHouse. it uses internally

Jump to

Keyboard shortcuts

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