chschema

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2024 License: BSD-2-Clause Imports: 25 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Append

func Append(fmter Formatter, b []byte, v any) []byte

func AppendBool

func AppendBool(dst []byte, v bool) []byte

func AppendBytes

func AppendBytes(b []byte, bytes []byte) []byte

func AppendError

func AppendError(b []byte, err error) []byte

func AppendFloat

func AppendFloat(dst []byte, v float64) []byte

func AppendIdent

func AppendIdent(b []byte, field string) []byte

func AppendName

func AppendName(b []byte, field string) []byte

func AppendNull

func AppendNull(b []byte) []byte

func AppendQuery

func AppendQuery(b []byte, query string, args ...any) []byte

func AppendQueryAppender

func AppendQueryAppender(fmter Formatter, b []byte, app QueryAppender) []byte

func AppendString

func AppendString(b []byte, s string) []byte

func AppendTime

func AppendTime(b []byte, tm time.Time) []byte

func AppendValue

func AppendValue(fmter Formatter, b []byte, v reflect.Value) []byte

func FormatQuery

func FormatQuery(query string, args ...any) string

func SetTableNameInflector

func SetTableNameInflector(fn func(string) string)

SetTableNameInflector overrides the default func that pluralizes model name to get table name, e.g. my_article becomes my_articles.

Types

type AfterScanRowHook

type AfterScanRowHook interface {
	AfterScanRow(context.Context) error
}

type AppenderFunc

type AppenderFunc func(fmter Formatter, b []byte, v reflect.Value) []byte

func Appender

func Appender(typ reflect.Type) AppenderFunc

type ArrayArrayBoolColumn

type ArrayArrayBoolColumn struct {
	ColumnOf[[][]bool]
	// contains filtered or unexported fields
}

func (*ArrayArrayBoolColumn) Init

func (c *ArrayArrayBoolColumn) Init(chType string) error

func (*ArrayArrayBoolColumn) ReadFrom

func (c *ArrayArrayBoolColumn) ReadFrom(rd *chproto.Reader, numRow int) error

func (*ArrayArrayBoolColumn) Type

func (c *ArrayArrayBoolColumn) Type() reflect.Type

func (*ArrayArrayBoolColumn) WriteData

func (c *ArrayArrayBoolColumn) WriteData(wr *chproto.Writer) error

func (*ArrayArrayBoolColumn) WriteOffset

func (c *ArrayArrayBoolColumn) WriteOffset(wr *chproto.Writer, offset int) int

func (*ArrayArrayBoolColumn) WriteTo

func (c *ArrayArrayBoolColumn) WriteTo(wr *chproto.Writer) error

type ArrayArrayBytesColumn

type ArrayArrayBytesColumn struct {
	ColumnOf[[][][]byte]
	// contains filtered or unexported fields
}

func (*ArrayArrayBytesColumn) Init

func (c *ArrayArrayBytesColumn) Init(chType string) error

func (*ArrayArrayBytesColumn) ReadFrom

func (c *ArrayArrayBytesColumn) ReadFrom(rd *chproto.Reader, numRow int) error

func (*ArrayArrayBytesColumn) Type

func (*ArrayArrayBytesColumn) WriteData

func (c *ArrayArrayBytesColumn) WriteData(wr *chproto.Writer) error

func (*ArrayArrayBytesColumn) WriteOffset

func (c *ArrayArrayBytesColumn) WriteOffset(wr *chproto.Writer, offset int) int

func (*ArrayArrayBytesColumn) WriteTo

func (c *ArrayArrayBytesColumn) WriteTo(wr *chproto.Writer) error

type ArrayArrayDateTimeColumn

type ArrayArrayDateTimeColumn struct {
	ColumnOf[[][]time.Time]
	// contains filtered or unexported fields
}

func (*ArrayArrayDateTimeColumn) Init

func (c *ArrayArrayDateTimeColumn) Init(chType string) error

func (*ArrayArrayDateTimeColumn) ReadFrom

func (c *ArrayArrayDateTimeColumn) ReadFrom(rd *chproto.Reader, numRow int) error

func (*ArrayArrayDateTimeColumn) Type

func (*ArrayArrayDateTimeColumn) WriteData

func (c *ArrayArrayDateTimeColumn) WriteData(wr *chproto.Writer) error

func (*ArrayArrayDateTimeColumn) WriteOffset

func (c *ArrayArrayDateTimeColumn) WriteOffset(wr *chproto.Writer, offset int) int

func (*ArrayArrayDateTimeColumn) WriteTo

func (c *ArrayArrayDateTimeColumn) WriteTo(wr *chproto.Writer) error

type ArrayArrayEnumColumn

type ArrayArrayEnumColumn struct {
	ColumnOf[[][]string]
	// contains filtered or unexported fields
}

func (*ArrayArrayEnumColumn) Init

func (c *ArrayArrayEnumColumn) Init(chType string) error

func (*ArrayArrayEnumColumn) ReadFrom

func (c *ArrayArrayEnumColumn) ReadFrom(rd *chproto.Reader, numRow int) error

func (*ArrayArrayEnumColumn) Type

func (c *ArrayArrayEnumColumn) Type() reflect.Type

func (*ArrayArrayEnumColumn) WriteData

func (c *ArrayArrayEnumColumn) WriteData(wr *chproto.Writer) error

func (*ArrayArrayEnumColumn) WriteOffset

func (c *ArrayArrayEnumColumn) WriteOffset(wr *chproto.Writer, offset int) int

func (*ArrayArrayEnumColumn) WriteTo

func (c *ArrayArrayEnumColumn) WriteTo(wr *chproto.Writer) error

type ArrayArrayFloat32Column

type ArrayArrayFloat32Column struct {
	ColumnOf[[][]float32]
	// contains filtered or unexported fields
}

func (*ArrayArrayFloat32Column) Init

func (c *ArrayArrayFloat32Column) Init(chType string) error

func (*ArrayArrayFloat32Column) ReadFrom

func (c *ArrayArrayFloat32Column) ReadFrom(rd *chproto.Reader, numRow int) error

func (*ArrayArrayFloat32Column) Type

func (*ArrayArrayFloat32Column) WriteData

func (c *ArrayArrayFloat32Column) WriteData(wr *chproto.Writer) error

func (*ArrayArrayFloat32Column) WriteOffset

func (c *ArrayArrayFloat32Column) WriteOffset(wr *chproto.Writer, offset int) int

func (*ArrayArrayFloat32Column) WriteTo

func (c *ArrayArrayFloat32Column) WriteTo(wr *chproto.Writer) error

type ArrayArrayFloat64Column

type ArrayArrayFloat64Column struct {
	ColumnOf[[][]float64]
	// contains filtered or unexported fields
}

func (*ArrayArrayFloat64Column) Init

func (c *ArrayArrayFloat64Column) Init(chType string) error

func (*ArrayArrayFloat64Column) ReadFrom

func (c *ArrayArrayFloat64Column) ReadFrom(rd *chproto.Reader, numRow int) error

func (*ArrayArrayFloat64Column) Type

func (*ArrayArrayFloat64Column) WriteData

func (c *ArrayArrayFloat64Column) WriteData(wr *chproto.Writer) error

func (*ArrayArrayFloat64Column) WriteOffset

func (c *ArrayArrayFloat64Column) WriteOffset(wr *chproto.Writer, offset int) int

func (*ArrayArrayFloat64Column) WriteTo

func (c *ArrayArrayFloat64Column) WriteTo(wr *chproto.Writer) error

type ArrayArrayInt16Column

type ArrayArrayInt16Column struct {
	ColumnOf[[][]int16]
	// contains filtered or unexported fields
}

func (*ArrayArrayInt16Column) Init

func (c *ArrayArrayInt16Column) Init(chType string) error

func (*ArrayArrayInt16Column) ReadFrom

func (c *ArrayArrayInt16Column) ReadFrom(rd *chproto.Reader, numRow int) error

func (*ArrayArrayInt16Column) Type

func (*ArrayArrayInt16Column) WriteData

func (c *ArrayArrayInt16Column) WriteData(wr *chproto.Writer) error

func (*ArrayArrayInt16Column) WriteOffset

func (c *ArrayArrayInt16Column) WriteOffset(wr *chproto.Writer, offset int) int

func (*ArrayArrayInt16Column) WriteTo

func (c *ArrayArrayInt16Column) WriteTo(wr *chproto.Writer) error

type ArrayArrayInt32Column

type ArrayArrayInt32Column struct {
	ColumnOf[[][]int32]
	// contains filtered or unexported fields
}

func (*ArrayArrayInt32Column) Init

func (c *ArrayArrayInt32Column) Init(chType string) error

func (*ArrayArrayInt32Column) ReadFrom

func (c *ArrayArrayInt32Column) ReadFrom(rd *chproto.Reader, numRow int) error

func (*ArrayArrayInt32Column) Type

func (*ArrayArrayInt32Column) WriteData

func (c *ArrayArrayInt32Column) WriteData(wr *chproto.Writer) error

func (*ArrayArrayInt32Column) WriteOffset

func (c *ArrayArrayInt32Column) WriteOffset(wr *chproto.Writer, offset int) int

func (*ArrayArrayInt32Column) WriteTo

func (c *ArrayArrayInt32Column) WriteTo(wr *chproto.Writer) error

type ArrayArrayInt64Column

type ArrayArrayInt64Column struct {
	ColumnOf[[][]int64]
	// contains filtered or unexported fields
}

func (*ArrayArrayInt64Column) Init

func (c *ArrayArrayInt64Column) Init(chType string) error

func (*ArrayArrayInt64Column) ReadFrom

func (c *ArrayArrayInt64Column) ReadFrom(rd *chproto.Reader, numRow int) error

func (*ArrayArrayInt64Column) Type

func (*ArrayArrayInt64Column) WriteData

func (c *ArrayArrayInt64Column) WriteData(wr *chproto.Writer) error

func (*ArrayArrayInt64Column) WriteOffset

func (c *ArrayArrayInt64Column) WriteOffset(wr *chproto.Writer, offset int) int

func (*ArrayArrayInt64Column) WriteTo

func (c *ArrayArrayInt64Column) WriteTo(wr *chproto.Writer) error

type ArrayArrayInt8Column

type ArrayArrayInt8Column struct {
	ColumnOf[[][]int8]
	// contains filtered or unexported fields
}

func (*ArrayArrayInt8Column) Init

func (c *ArrayArrayInt8Column) Init(chType string) error

func (*ArrayArrayInt8Column) ReadFrom

func (c *ArrayArrayInt8Column) ReadFrom(rd *chproto.Reader, numRow int) error

func (*ArrayArrayInt8Column) Type

func (c *ArrayArrayInt8Column) Type() reflect.Type

func (*ArrayArrayInt8Column) WriteData

func (c *ArrayArrayInt8Column) WriteData(wr *chproto.Writer) error

func (*ArrayArrayInt8Column) WriteOffset

func (c *ArrayArrayInt8Column) WriteOffset(wr *chproto.Writer, offset int) int

func (*ArrayArrayInt8Column) WriteTo

func (c *ArrayArrayInt8Column) WriteTo(wr *chproto.Writer) error

type ArrayArrayStringColumn

type ArrayArrayStringColumn struct {
	ColumnOf[[][]string]
	// contains filtered or unexported fields
}

func (*ArrayArrayStringColumn) Init

func (c *ArrayArrayStringColumn) Init(chType string) error

func (*ArrayArrayStringColumn) ReadFrom

func (c *ArrayArrayStringColumn) ReadFrom(rd *chproto.Reader, numRow int) error

func (*ArrayArrayStringColumn) Type

func (*ArrayArrayStringColumn) WriteData

func (c *ArrayArrayStringColumn) WriteData(wr *chproto.Writer) error

func (*ArrayArrayStringColumn) WriteOffset

func (c *ArrayArrayStringColumn) WriteOffset(wr *chproto.Writer, offset int) int

func (*ArrayArrayStringColumn) WriteTo

func (c *ArrayArrayStringColumn) WriteTo(wr *chproto.Writer) error

type ArrayArrayUInt16Column

type ArrayArrayUInt16Column struct {
	ColumnOf[[][]uint16]
	// contains filtered or unexported fields
}

func (*ArrayArrayUInt16Column) Init

func (c *ArrayArrayUInt16Column) Init(chType string) error

func (*ArrayArrayUInt16Column) ReadFrom

func (c *ArrayArrayUInt16Column) ReadFrom(rd *chproto.Reader, numRow int) error

func (*ArrayArrayUInt16Column) Type

func (*ArrayArrayUInt16Column) WriteData

func (c *ArrayArrayUInt16Column) WriteData(wr *chproto.Writer) error

func (*ArrayArrayUInt16Column) WriteOffset

func (c *ArrayArrayUInt16Column) WriteOffset(wr *chproto.Writer, offset int) int

func (*ArrayArrayUInt16Column) WriteTo

func (c *ArrayArrayUInt16Column) WriteTo(wr *chproto.Writer) error

type ArrayArrayUInt32Column

type ArrayArrayUInt32Column struct {
	ColumnOf[[][]uint32]
	// contains filtered or unexported fields
}

func (*ArrayArrayUInt32Column) Init

func (c *ArrayArrayUInt32Column) Init(chType string) error

func (*ArrayArrayUInt32Column) ReadFrom

func (c *ArrayArrayUInt32Column) ReadFrom(rd *chproto.Reader, numRow int) error

func (*ArrayArrayUInt32Column) Type

func (*ArrayArrayUInt32Column) WriteData

func (c *ArrayArrayUInt32Column) WriteData(wr *chproto.Writer) error

func (*ArrayArrayUInt32Column) WriteOffset

func (c *ArrayArrayUInt32Column) WriteOffset(wr *chproto.Writer, offset int) int

func (*ArrayArrayUInt32Column) WriteTo

func (c *ArrayArrayUInt32Column) WriteTo(wr *chproto.Writer) error

type ArrayArrayUInt64Column

type ArrayArrayUInt64Column struct {
	ColumnOf[[][]uint64]
	// contains filtered or unexported fields
}

func (*ArrayArrayUInt64Column) Init

func (c *ArrayArrayUInt64Column) Init(chType string) error

func (*ArrayArrayUInt64Column) ReadFrom

func (c *ArrayArrayUInt64Column) ReadFrom(rd *chproto.Reader, numRow int) error

func (*ArrayArrayUInt64Column) Type

func (*ArrayArrayUInt64Column) WriteData

func (c *ArrayArrayUInt64Column) WriteData(wr *chproto.Writer) error

func (*ArrayArrayUInt64Column) WriteOffset

func (c *ArrayArrayUInt64Column) WriteOffset(wr *chproto.Writer, offset int) int

func (*ArrayArrayUInt64Column) WriteTo

func (c *ArrayArrayUInt64Column) WriteTo(wr *chproto.Writer) error

type ArrayArrayUInt8Column

type ArrayArrayUInt8Column struct {
	ColumnOf[[][]uint8]
	// contains filtered or unexported fields
}

func (*ArrayArrayUInt8Column) Init

func (c *ArrayArrayUInt8Column) Init(chType string) error

func (*ArrayArrayUInt8Column) ReadFrom

func (c *ArrayArrayUInt8Column) ReadFrom(rd *chproto.Reader, numRow int) error

func (*ArrayArrayUInt8Column) Type

func (*ArrayArrayUInt8Column) WriteData

func (c *ArrayArrayUInt8Column) WriteData(wr *chproto.Writer) error

func (*ArrayArrayUInt8Column) WriteOffset

func (c *ArrayArrayUInt8Column) WriteOffset(wr *chproto.Writer, offset int) int

func (*ArrayArrayUInt8Column) WriteTo

func (c *ArrayArrayUInt8Column) WriteTo(wr *chproto.Writer) error

type ArrayBoolColumn

type ArrayBoolColumn struct {
	ColumnOf[[]bool]
	// contains filtered or unexported fields
}

func (*ArrayBoolColumn) Init

func (c *ArrayBoolColumn) Init(chType string) error

func (*ArrayBoolColumn) ReadFrom

func (c *ArrayBoolColumn) ReadFrom(rd *chproto.Reader, numRow int) error

func (*ArrayBoolColumn) Type

func (c *ArrayBoolColumn) Type() reflect.Type

func (*ArrayBoolColumn) WriteData

func (c *ArrayBoolColumn) WriteData(wr *chproto.Writer) error

func (*ArrayBoolColumn) WriteOffset

func (c *ArrayBoolColumn) WriteOffset(wr *chproto.Writer, offset int) int

func (*ArrayBoolColumn) WriteTo

func (c *ArrayBoolColumn) WriteTo(wr *chproto.Writer) error

type ArrayBytesColumn

type ArrayBytesColumn struct {
	ColumnOf[[][]byte]
	// contains filtered or unexported fields
}

func (*ArrayBytesColumn) Init

func (c *ArrayBytesColumn) Init(chType string) error

func (*ArrayBytesColumn) ReadFrom

func (c *ArrayBytesColumn) ReadFrom(rd *chproto.Reader, numRow int) error

func (*ArrayBytesColumn) Type

func (c *ArrayBytesColumn) Type() reflect.Type

func (*ArrayBytesColumn) WriteData

func (c *ArrayBytesColumn) WriteData(wr *chproto.Writer) error

func (*ArrayBytesColumn) WriteOffset

func (c *ArrayBytesColumn) WriteOffset(wr *chproto.Writer, offset int) int

func (*ArrayBytesColumn) WriteTo

func (c *ArrayBytesColumn) WriteTo(wr *chproto.Writer) error

type ArrayColumnar

type ArrayColumnar interface {
	WriteOffset(wr *chproto.Writer, offset int) int
	WriteData(wr *chproto.Writer) error
}

type ArrayDateTimeColumn

type ArrayDateTimeColumn struct {
	ColumnOf[[]time.Time]
	// contains filtered or unexported fields
}

func (*ArrayDateTimeColumn) Init

func (c *ArrayDateTimeColumn) Init(chType string) error

func (*ArrayDateTimeColumn) ReadFrom

func (c *ArrayDateTimeColumn) ReadFrom(rd *chproto.Reader, numRow int) error

func (*ArrayDateTimeColumn) Type

func (c *ArrayDateTimeColumn) Type() reflect.Type

func (*ArrayDateTimeColumn) WriteData

func (c *ArrayDateTimeColumn) WriteData(wr *chproto.Writer) error

func (*ArrayDateTimeColumn) WriteOffset

func (c *ArrayDateTimeColumn) WriteOffset(wr *chproto.Writer, offset int) int

func (*ArrayDateTimeColumn) WriteTo

func (c *ArrayDateTimeColumn) WriteTo(wr *chproto.Writer) error

type ArrayEnumColumn

type ArrayEnumColumn struct {
	ColumnOf[[]string]
	// contains filtered or unexported fields
}

func (*ArrayEnumColumn) Init

func (c *ArrayEnumColumn) Init(chType string) error

func (*ArrayEnumColumn) ReadFrom

func (c *ArrayEnumColumn) ReadFrom(rd *chproto.Reader, numRow int) error

func (*ArrayEnumColumn) Type

func (c *ArrayEnumColumn) Type() reflect.Type

func (*ArrayEnumColumn) WriteData

func (c *ArrayEnumColumn) WriteData(wr *chproto.Writer) error

func (*ArrayEnumColumn) WriteOffset

func (c *ArrayEnumColumn) WriteOffset(wr *chproto.Writer, offset int) int

func (*ArrayEnumColumn) WriteTo

func (c *ArrayEnumColumn) WriteTo(wr *chproto.Writer) error

type ArrayFloat32Column

type ArrayFloat32Column struct {
	ColumnOf[[]float32]
	// contains filtered or unexported fields
}

func (*ArrayFloat32Column) Init

func (c *ArrayFloat32Column) Init(chType string) error

func (*ArrayFloat32Column) ReadFrom

func (c *ArrayFloat32Column) ReadFrom(rd *chproto.Reader, numRow int) error

func (*ArrayFloat32Column) Type

func (c *ArrayFloat32Column) Type() reflect.Type

func (*ArrayFloat32Column) WriteData

func (c *ArrayFloat32Column) WriteData(wr *chproto.Writer) error

func (*ArrayFloat32Column) WriteOffset

func (c *ArrayFloat32Column) WriteOffset(wr *chproto.Writer, offset int) int

func (*ArrayFloat32Column) WriteTo

func (c *ArrayFloat32Column) WriteTo(wr *chproto.Writer) error

type ArrayFloat64Column

type ArrayFloat64Column struct {
	ColumnOf[[]float64]
	// contains filtered or unexported fields
}

func (*ArrayFloat64Column) Init

func (c *ArrayFloat64Column) Init(chType string) error

func (*ArrayFloat64Column) ReadFrom

func (c *ArrayFloat64Column) ReadFrom(rd *chproto.Reader, numRow int) error

func (*ArrayFloat64Column) Type

func (c *ArrayFloat64Column) Type() reflect.Type

func (*ArrayFloat64Column) WriteData

func (c *ArrayFloat64Column) WriteData(wr *chproto.Writer) error

func (*ArrayFloat64Column) WriteOffset

func (c *ArrayFloat64Column) WriteOffset(wr *chproto.Writer, offset int) int

func (*ArrayFloat64Column) WriteTo

func (c *ArrayFloat64Column) WriteTo(wr *chproto.Writer) error

type ArrayInt16Column

type ArrayInt16Column struct {
	ColumnOf[[]int16]
	// contains filtered or unexported fields
}

func (*ArrayInt16Column) Init

func (c *ArrayInt16Column) Init(chType string) error

func (*ArrayInt16Column) ReadFrom

func (c *ArrayInt16Column) ReadFrom(rd *chproto.Reader, numRow int) error

func (*ArrayInt16Column) Type

func (c *ArrayInt16Column) Type() reflect.Type

func (*ArrayInt16Column) WriteData

func (c *ArrayInt16Column) WriteData(wr *chproto.Writer) error

func (*ArrayInt16Column) WriteOffset

func (c *ArrayInt16Column) WriteOffset(wr *chproto.Writer, offset int) int

func (*ArrayInt16Column) WriteTo

func (c *ArrayInt16Column) WriteTo(wr *chproto.Writer) error

type ArrayInt32Column

type ArrayInt32Column struct {
	ColumnOf[[]int32]
	// contains filtered or unexported fields
}

func (*ArrayInt32Column) Init

func (c *ArrayInt32Column) Init(chType string) error

func (*ArrayInt32Column) ReadFrom

func (c *ArrayInt32Column) ReadFrom(rd *chproto.Reader, numRow int) error

func (*ArrayInt32Column) Type

func (c *ArrayInt32Column) Type() reflect.Type

func (*ArrayInt32Column) WriteData

func (c *ArrayInt32Column) WriteData(wr *chproto.Writer) error

func (*ArrayInt32Column) WriteOffset

func (c *ArrayInt32Column) WriteOffset(wr *chproto.Writer, offset int) int

func (*ArrayInt32Column) WriteTo

func (c *ArrayInt32Column) WriteTo(wr *chproto.Writer) error

type ArrayInt64Column

type ArrayInt64Column struct {
	ColumnOf[[]int64]
	// contains filtered or unexported fields
}

func (*ArrayInt64Column) Init

func (c *ArrayInt64Column) Init(chType string) error

func (*ArrayInt64Column) ReadFrom

func (c *ArrayInt64Column) ReadFrom(rd *chproto.Reader, numRow int) error

func (*ArrayInt64Column) Type

func (c *ArrayInt64Column) Type() reflect.Type

func (*ArrayInt64Column) WriteData

func (c *ArrayInt64Column) WriteData(wr *chproto.Writer) error

func (*ArrayInt64Column) WriteOffset

func (c *ArrayInt64Column) WriteOffset(wr *chproto.Writer, offset int) int

func (*ArrayInt64Column) WriteTo

func (c *ArrayInt64Column) WriteTo(wr *chproto.Writer) error

type ArrayInt8Column

type ArrayInt8Column struct {
	ColumnOf[[]int8]
	// contains filtered or unexported fields
}

func (*ArrayInt8Column) Init

func (c *ArrayInt8Column) Init(chType string) error

func (*ArrayInt8Column) ReadFrom

func (c *ArrayInt8Column) ReadFrom(rd *chproto.Reader, numRow int) error

func (*ArrayInt8Column) Type

func (c *ArrayInt8Column) Type() reflect.Type

func (*ArrayInt8Column) WriteData

func (c *ArrayInt8Column) WriteData(wr *chproto.Writer) error

func (*ArrayInt8Column) WriteOffset

func (c *ArrayInt8Column) WriteOffset(wr *chproto.Writer, offset int) int

func (*ArrayInt8Column) WriteTo

func (c *ArrayInt8Column) WriteTo(wr *chproto.Writer) error

type ArrayLCStringColumn

type ArrayLCStringColumn struct {
	ArrayStringColumn
	// contains filtered or unexported fields
}

func (*ArrayLCStringColumn) ConvertAssign

func (c *ArrayLCStringColumn) ConvertAssign(idx int, dest reflect.Value) error

func (*ArrayLCStringColumn) ReadFrom

func (c *ArrayLCStringColumn) ReadFrom(rd *chproto.Reader, numRow int) error

func (*ArrayLCStringColumn) WriteData

func (c *ArrayLCStringColumn) WriteData(wr *chproto.Writer) error

func (*ArrayLCStringColumn) WriteTo

func (c *ArrayLCStringColumn) WriteTo(wr *chproto.Writer) error

type ArrayStringColumn

type ArrayStringColumn struct {
	ColumnOf[[]string]
	// contains filtered or unexported fields
}

func (*ArrayStringColumn) Init

func (c *ArrayStringColumn) Init(chType string) error

func (*ArrayStringColumn) ReadFrom

func (c *ArrayStringColumn) ReadFrom(rd *chproto.Reader, numRow int) error

func (*ArrayStringColumn) Type

func (c *ArrayStringColumn) Type() reflect.Type

func (*ArrayStringColumn) WriteData

func (c *ArrayStringColumn) WriteData(wr *chproto.Writer) error

func (*ArrayStringColumn) WriteOffset

func (c *ArrayStringColumn) WriteOffset(wr *chproto.Writer, offset int) int

func (*ArrayStringColumn) WriteTo

func (c *ArrayStringColumn) WriteTo(wr *chproto.Writer) error

type ArrayUInt16Column

type ArrayUInt16Column struct {
	ColumnOf[[]uint16]
	// contains filtered or unexported fields
}

func (*ArrayUInt16Column) Init

func (c *ArrayUInt16Column) Init(chType string) error

func (*ArrayUInt16Column) ReadFrom

func (c *ArrayUInt16Column) ReadFrom(rd *chproto.Reader, numRow int) error

func (*ArrayUInt16Column) Type

func (c *ArrayUInt16Column) Type() reflect.Type

func (*ArrayUInt16Column) WriteData

func (c *ArrayUInt16Column) WriteData(wr *chproto.Writer) error

func (*ArrayUInt16Column) WriteOffset

func (c *ArrayUInt16Column) WriteOffset(wr *chproto.Writer, offset int) int

func (*ArrayUInt16Column) WriteTo

func (c *ArrayUInt16Column) WriteTo(wr *chproto.Writer) error

type ArrayUInt32Column

type ArrayUInt32Column struct {
	ColumnOf[[]uint32]
	// contains filtered or unexported fields
}

func (*ArrayUInt32Column) Init

func (c *ArrayUInt32Column) Init(chType string) error

func (*ArrayUInt32Column) ReadFrom

func (c *ArrayUInt32Column) ReadFrom(rd *chproto.Reader, numRow int) error

func (*ArrayUInt32Column) Type

func (c *ArrayUInt32Column) Type() reflect.Type

func (*ArrayUInt32Column) WriteData

func (c *ArrayUInt32Column) WriteData(wr *chproto.Writer) error

func (*ArrayUInt32Column) WriteOffset

func (c *ArrayUInt32Column) WriteOffset(wr *chproto.Writer, offset int) int

func (*ArrayUInt32Column) WriteTo

func (c *ArrayUInt32Column) WriteTo(wr *chproto.Writer) error

type ArrayUInt64Column

type ArrayUInt64Column struct {
	ColumnOf[[]uint64]
	// contains filtered or unexported fields
}

func (*ArrayUInt64Column) Init

func (c *ArrayUInt64Column) Init(chType string) error

func (*ArrayUInt64Column) ReadFrom

func (c *ArrayUInt64Column) ReadFrom(rd *chproto.Reader, numRow int) error

func (*ArrayUInt64Column) Type

func (c *ArrayUInt64Column) Type() reflect.Type

func (*ArrayUInt64Column) WriteData

func (c *ArrayUInt64Column) WriteData(wr *chproto.Writer) error

func (*ArrayUInt64Column) WriteOffset

func (c *ArrayUInt64Column) WriteOffset(wr *chproto.Writer, offset int) int

func (*ArrayUInt64Column) WriteTo

func (c *ArrayUInt64Column) WriteTo(wr *chproto.Writer) error

type ArrayUInt8Column

type ArrayUInt8Column struct {
	ColumnOf[[]uint8]
	// contains filtered or unexported fields
}

func (*ArrayUInt8Column) Init

func (c *ArrayUInt8Column) Init(chType string) error

func (*ArrayUInt8Column) ReadFrom

func (c *ArrayUInt8Column) ReadFrom(rd *chproto.Reader, numRow int) error

func (*ArrayUInt8Column) Type

func (c *ArrayUInt8Column) Type() reflect.Type

func (*ArrayUInt8Column) WriteData

func (c *ArrayUInt8Column) WriteData(wr *chproto.Writer) error

func (*ArrayUInt8Column) WriteOffset

func (c *ArrayUInt8Column) WriteOffset(wr *chproto.Writer, offset int) int

func (*ArrayUInt8Column) WriteTo

func (c *ArrayUInt8Column) WriteTo(wr *chproto.Writer) error

type ArrayValue

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

func Array

func Array(vi interface{}) *ArrayValue

func (*ArrayValue) AppendQuery

func (a *ArrayValue) AppendQuery(fmter Formatter, b []byte) ([]byte, error)

type BFloat16HistColumn

type BFloat16HistColumn struct {
	ColumnOf[map[bfloat16.T]uint64]
}

func (*BFloat16HistColumn) ReadFrom

func (c *BFloat16HistColumn) ReadFrom(rd *chproto.Reader, numRow int) error

func (BFloat16HistColumn) Type

func (c BFloat16HistColumn) Type() reflect.Type

func (BFloat16HistColumn) WriteTo

func (c BFloat16HistColumn) WriteTo(wr *chproto.Writer) error

type Block

type Block struct {
	Table *Table

	NumColumn int // read-only
	NumRow    int // read-only

	Columns []*Column
	// contains filtered or unexported fields
}

func NewBlock

func NewBlock(table *Table, numCol, numRow int) *Block

func (*Block) Column

func (b *Block) Column(colName, colType string) *Column

func (*Block) ColumnForField

func (b *Block) ColumnForField(field *Field) *Column

func (*Block) WriteTo

func (b *Block) WriteTo(wr *chproto.Writer) error

type BoolColumn

type BoolColumn struct {
	ColumnOf[bool]
}

func (*BoolColumn) AppendValue

func (c *BoolColumn) AppendValue(v reflect.Value)

func (BoolColumn) ConvertAssign

func (c BoolColumn) ConvertAssign(idx int, v reflect.Value) error

func (*BoolColumn) ReadFrom

func (c *BoolColumn) ReadFrom(rd *chproto.Reader, numRow int) error

func (*BoolColumn) Type

func (c *BoolColumn) Type() reflect.Type

func (*BoolColumn) WriteTo

func (c *BoolColumn) WriteTo(wr *chproto.Writer) error

type BytesColumn

type BytesColumn struct {
	ColumnOf[[]byte]
}

func (*BytesColumn) AppendValue

func (c *BytesColumn) AppendValue(v reflect.Value)

func (*BytesColumn) ReadFrom

func (c *BytesColumn) ReadFrom(rd *chproto.Reader, numRow int) error

func (*BytesColumn) Type

func (c *BytesColumn) Type() reflect.Type

func (*BytesColumn) WriteTo

func (c *BytesColumn) WriteTo(wr *chproto.Writer) error

type CHModel

type CHModel struct{}

type Column

type Column struct {
	Name  string
	Type  string
	Field *Field

	Columnar
}

func (*Column) String

func (c *Column) String() string

type ColumnOf

type ColumnOf[T any] struct {
	Column []T
}

func (*ColumnOf[T]) AllocForReading

func (c *ColumnOf[T]) AllocForReading(numRow int)

func (*ColumnOf[T]) AppendValue

func (c *ColumnOf[T]) AppendValue(v reflect.Value)

func (*ColumnOf[T]) ConvertAssign

func (c *ColumnOf[T]) ConvertAssign(idx int, dest reflect.Value) error

func (ColumnOf[T]) Index

func (c ColumnOf[T]) Index(idx int) any

func (*ColumnOf[T]) Init

func (c *ColumnOf[T]) Init(chType string) error

func (ColumnOf[T]) Len

func (c ColumnOf[T]) Len() int

func (ColumnOf[T]) Nullable

func (c ColumnOf[T]) Nullable(nulls UInt8Column) any

func (*ColumnOf[T]) ResetForWriting

func (c *ColumnOf[T]) ResetForWriting(numRow int)

func (*ColumnOf[T]) Set

func (c *ColumnOf[T]) Set(v any)

func (ColumnOf[T]) Slice

func (c ColumnOf[T]) Slice(s, e int) any

func (ColumnOf[T]) Value

func (c ColumnOf[T]) Value() any

type Columnar

type Columnar interface {
	Init(chType string) error
	AllocForReading(numRow int)
	ResetForWriting(numRow int)

	Type() reflect.Type
	Set(v any)
	AppendValue(v reflect.Value)
	Value() any
	Nullable(nulls UInt8Column) any
	Len() int
	Index(idx int) any
	Slice(s, e int) any
	ConvertAssign(idx int, dest reflect.Value) error

	ReadFrom(rd *chproto.Reader, numRow int) error
	WriteTo(wr *chproto.Writer) error
}

func NewArrayArrayBoolColumn

func NewArrayArrayBoolColumn() Columnar

func NewArrayArrayBytesColumn

func NewArrayArrayBytesColumn() Columnar

func NewArrayArrayDateTimeColumn

func NewArrayArrayDateTimeColumn() Columnar

func NewArrayArrayEnumColumn

func NewArrayArrayEnumColumn() Columnar

func NewArrayArrayFloat32Column

func NewArrayArrayFloat32Column() Columnar

func NewArrayArrayFloat64Column

func NewArrayArrayFloat64Column() Columnar

func NewArrayArrayInt16Column

func NewArrayArrayInt16Column() Columnar

func NewArrayArrayInt32Column

func NewArrayArrayInt32Column() Columnar

func NewArrayArrayInt64Column

func NewArrayArrayInt64Column() Columnar

func NewArrayArrayInt8Column

func NewArrayArrayInt8Column() Columnar

func NewArrayArrayStringColumn

func NewArrayArrayStringColumn() Columnar

func NewArrayArrayUInt16Column

func NewArrayArrayUInt16Column() Columnar

func NewArrayArrayUInt32Column

func NewArrayArrayUInt32Column() Columnar

func NewArrayArrayUInt64Column

func NewArrayArrayUInt64Column() Columnar

func NewArrayArrayUInt8Column

func NewArrayArrayUInt8Column() Columnar

func NewArrayBoolColumn

func NewArrayBoolColumn() Columnar

func NewArrayBytesColumn

func NewArrayBytesColumn() Columnar

func NewArrayDateTimeColumn

func NewArrayDateTimeColumn() Columnar

func NewArrayEnumColumn

func NewArrayEnumColumn() Columnar

func NewArrayFloat32Column

func NewArrayFloat32Column() Columnar

func NewArrayFloat64Column

func NewArrayFloat64Column() Columnar

func NewArrayInt16Column

func NewArrayInt16Column() Columnar

func NewArrayInt32Column

func NewArrayInt32Column() Columnar

func NewArrayInt64Column

func NewArrayInt64Column() Columnar

func NewArrayInt8Column

func NewArrayInt8Column() Columnar

func NewArrayLCStringColumn

func NewArrayLCStringColumn() Columnar

func NewArrayStringColumn

func NewArrayStringColumn() Columnar

func NewArrayUInt16Column

func NewArrayUInt16Column() Columnar

func NewArrayUInt32Column

func NewArrayUInt32Column() Columnar

func NewArrayUInt64Column

func NewArrayUInt64Column() Columnar

func NewArrayUInt8Column

func NewArrayUInt8Column() Columnar

func NewBFloat16HistColumn

func NewBFloat16HistColumn() Columnar

func NewBoolColumn

func NewBoolColumn() Columnar

func NewBytesColumn

func NewBytesColumn() Columnar

func NewColumn

func NewColumn(chType string, typ reflect.Type) Columnar

func NewDateColumn

func NewDateColumn() Columnar

func NewDateTime64Column

func NewDateTime64Column() Columnar

func NewDateTimeColumn

func NewDateTimeColumn() Columnar

func NewEnumColumn

func NewEnumColumn() Columnar

func NewFloat32Column

func NewFloat32Column() Columnar

func NewFloat64Column

func NewFloat64Column() Columnar

func NewIPColumn

func NewIPColumn() Columnar

func NewInt16Column

func NewInt16Column() Columnar

func NewInt32Column

func NewInt32Column() Columnar

func NewInt64Column

func NewInt64Column() Columnar

func NewInt8Column

func NewInt8Column() Columnar

func NewJSONColumn

func NewJSONColumn() Columnar

func NewLCStringColumn

func NewLCStringColumn() Columnar

func NewStringColumn

func NewStringColumn() Columnar

func NewTimeColumn

func NewTimeColumn() Columnar

func NewUInt16Column

func NewUInt16Column() Columnar

func NewUInt32Column

func NewUInt32Column() Columnar

func NewUInt64Column

func NewUInt64Column() Columnar

func NewUInt8Column

func NewUInt8Column() Columnar

func NewUUIDColumn

func NewUUIDColumn() Columnar

type ColumnsAppender

type ColumnsAppender interface {
	AppendColumns(fmter Formatter, b []byte) ([]byte, error)
}

type DateColumn

type DateColumn struct {
	DateTimeColumn
}

func (*DateColumn) ReadFrom

func (c *DateColumn) ReadFrom(rd *chproto.Reader, numRow int) error

func (DateColumn) WriteTo

func (c DateColumn) WriteTo(wr *chproto.Writer) error

type DateTime64Column

type DateTime64Column struct {
	ColumnOf[time.Time]
	// contains filtered or unexported fields
}

func (*DateTime64Column) ConvertAssign

func (c *DateTime64Column) ConvertAssign(idx int, v reflect.Value) error

func (*DateTime64Column) Init

func (c *DateTime64Column) Init(chType string) error

func (*DateTime64Column) ReadFrom

func (c *DateTime64Column) ReadFrom(rd *chproto.Reader, numRow int) error

func (*DateTime64Column) Type

func (c *DateTime64Column) Type() reflect.Type

func (*DateTime64Column) WriteTo

func (c *DateTime64Column) WriteTo(wr *chproto.Writer) error

type DateTimeColumn

type DateTimeColumn struct {
	ColumnOf[time.Time]
}

func (*DateTimeColumn) ReadFrom

func (c *DateTimeColumn) ReadFrom(rd *chproto.Reader, numRow int) error

func (*DateTimeColumn) Type

func (c *DateTimeColumn) Type() reflect.Type

func (*DateTimeColumn) WriteTo

func (c *DateTimeColumn) WriteTo(wr *chproto.Writer) error

type EnumColumn

type EnumColumn struct {
	StringColumn
	// contains filtered or unexported fields
}

func (*EnumColumn) Init

func (c *EnumColumn) Init(chType string) error

func (*EnumColumn) ReadFrom

func (c *EnumColumn) ReadFrom(rd *chproto.Reader, numRow int) error

func (*EnumColumn) WriteTo

func (c *EnumColumn) WriteTo(wr *chproto.Writer) error

type Field

type Field struct {
	Field reflect.StructField
	Type  reflect.Type
	Index []int

	GoName    string // struct field name, e.g. Id
	CHName    string // SQL name, .e.g. id
	Column    Safe   // escaped SQL name, e.g. "id"
	CHType    string
	CHDefault Safe

	NewColumn NewColumnFunc

	IsPK    bool
	NotNull bool
	// contains filtered or unexported fields
}

func (*Field) AppendValue

func (f *Field) AppendValue(fmter Formatter, b []byte, strct reflect.Value) []byte

func (*Field) String

func (f *Field) String() string

func (*Field) Value

func (f *Field) Value(strct reflect.Value) reflect.Value

type Float32Column

type Float32Column struct {
	NumericColumnOf[float32]
}

func (*Float32Column) AppendValue

func (c *Float32Column) AppendValue(v reflect.Value)

func (*Float32Column) ReadFrom

func (c *Float32Column) ReadFrom(rd *chproto.Reader, numRow int) error

func (*Float32Column) Type

func (c *Float32Column) Type() reflect.Type

func (*Float32Column) WriteTo

func (c *Float32Column) WriteTo(wr *chproto.Writer) error

type Float64Column

type Float64Column struct {
	NumericColumnOf[float64]
}

func (*Float64Column) AppendValue

func (c *Float64Column) AppendValue(v reflect.Value)

func (*Float64Column) ReadFrom

func (c *Float64Column) ReadFrom(rd *chproto.Reader, numRow int) error

func (*Float64Column) Type

func (c *Float64Column) Type() reflect.Type

func (*Float64Column) WriteTo

func (c *Float64Column) WriteTo(wr *chproto.Writer) error

type Formatter

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

func NewFormatter

func NewFormatter() Formatter

func (Formatter) AppendIdent

func (f Formatter) AppendIdent(b []byte, ident string) []byte

func (Formatter) AppendName

func (f Formatter) AppendName(b []byte, ident string) []byte

func (Formatter) AppendQuery

func (f Formatter) AppendQuery(b []byte, query string, args ...any) []byte

func (Formatter) FormatQuery

func (f Formatter) FormatQuery(query string, args ...any) string

func (Formatter) WithArg

func (f Formatter) WithArg(arg NamedArgAppender) Formatter

func (Formatter) WithNamedArg

func (f Formatter) WithNamedArg(name string, value any) Formatter

type IPColumn

type IPColumn struct {
	ColumnOf[net.IP]
}

func (*IPColumn) AppendValue

func (c *IPColumn) AppendValue(v reflect.Value)

func (IPColumn) ConvertAssign

func (c IPColumn) ConvertAssign(idx int, v reflect.Value) error

func (*IPColumn) ReadFrom

func (c *IPColumn) ReadFrom(rd *chproto.Reader, numRow int) error

func (IPColumn) Type

func (c IPColumn) Type() reflect.Type

func (IPColumn) WriteTo

func (c IPColumn) WriteTo(wr *chproto.Writer) error

type Ident

type Ident string

Ident represents a fully qualified SQL name, for example, table or column name.

func (Ident) AppendQuery

func (s Ident) AppendQuery(fmter Formatter, b []byte) ([]byte, error)

type Int16Column

type Int16Column struct {
	NumericColumnOf[int16]
}

func (*Int16Column) AppendValue

func (c *Int16Column) AppendValue(v reflect.Value)

func (*Int16Column) ReadFrom

func (c *Int16Column) ReadFrom(rd *chproto.Reader, numRow int) error

func (*Int16Column) Type

func (c *Int16Column) Type() reflect.Type

func (*Int16Column) WriteTo

func (c *Int16Column) WriteTo(wr *chproto.Writer) error

type Int32Column

type Int32Column struct {
	NumericColumnOf[int32]
}

func (*Int32Column) AppendValue

func (c *Int32Column) AppendValue(v reflect.Value)

func (*Int32Column) ReadFrom

func (c *Int32Column) ReadFrom(rd *chproto.Reader, numRow int) error

func (*Int32Column) Type

func (c *Int32Column) Type() reflect.Type

func (*Int32Column) WriteTo

func (c *Int32Column) WriteTo(wr *chproto.Writer) error

type Int64Column

type Int64Column struct {
	NumericColumnOf[int64]
}

func (*Int64Column) AppendValue

func (c *Int64Column) AppendValue(v reflect.Value)

func (*Int64Column) ReadFrom

func (c *Int64Column) ReadFrom(rd *chproto.Reader, numRow int) error

func (*Int64Column) Type

func (c *Int64Column) Type() reflect.Type

func (*Int64Column) WriteTo

func (c *Int64Column) WriteTo(wr *chproto.Writer) error

type Int8Column

type Int8Column struct {
	NumericColumnOf[int8]
}

func (*Int8Column) AppendValue

func (c *Int8Column) AppendValue(v reflect.Value)

func (*Int8Column) ReadFrom

func (c *Int8Column) ReadFrom(rd *chproto.Reader, numRow int) error

func (*Int8Column) Type

func (c *Int8Column) Type() reflect.Type

func (*Int8Column) WriteTo

func (c *Int8Column) WriteTo(wr *chproto.Writer) error

type JSONColumn

type JSONColumn struct {
	BytesColumn
	Values []reflect.Value
}

func (*JSONColumn) AppendValue

func (c *JSONColumn) AppendValue(v reflect.Value)

func (*JSONColumn) ConvertAssign

func (c *JSONColumn) ConvertAssign(idx int, v reflect.Value) error

func (*JSONColumn) Len

func (c *JSONColumn) Len() int

func (*JSONColumn) ResetForWriting

func (c *JSONColumn) ResetForWriting(numRow int)

func (*JSONColumn) WriteTo

func (c *JSONColumn) WriteTo(wr *chproto.Writer) error

type LCStringColumn

type LCStringColumn struct {
	StringColumn
}

func (*LCStringColumn) ReadFrom

func (c *LCStringColumn) ReadFrom(rd *chproto.Reader, numRow int) error

func (*LCStringColumn) WriteTo

func (c *LCStringColumn) WriteTo(wr *chproto.Writer) error

type Model

type Model interface {
	ScanBlock(*Block) error
}

type Name

type Name string

Name represents a SQL identifier, for example, table or column name.

func (Name) AppendQuery

func (s Name) AppendQuery(fmter Formatter, b []byte) ([]byte, error)

type NamedArgAppender

type NamedArgAppender interface {
	AppendNamedArg(fmter Formatter, b []byte, name string) ([]byte, bool)
}

type NewColumnFunc

type NewColumnFunc func() Columnar

func ColumnFactory

func ColumnFactory(chType string, typ reflect.Type) NewColumnFunc

func NewNullableColumnFunc

func NewNullableColumnFunc(fn NewColumnFunc) NewColumnFunc

type NullableColumn

type NullableColumn struct {
	Nulls  UInt8Column
	Values Columnar
	// contains filtered or unexported fields
}

func (*NullableColumn) AllocForReading

func (c *NullableColumn) AllocForReading(numRow int)

func (*NullableColumn) AppendValue

func (c *NullableColumn) AppendValue(v reflect.Value)

func (*NullableColumn) ConvertAssign

func (c *NullableColumn) ConvertAssign(idx int, dest reflect.Value) error

func (*NullableColumn) Index

func (c *NullableColumn) Index(idx int) any

func (*NullableColumn) Init

func (c *NullableColumn) Init(chType string) error

func (*NullableColumn) Len

func (c *NullableColumn) Len() int

func (*NullableColumn) Nullable

func (c *NullableColumn) Nullable(nulls UInt8Column) any

func (*NullableColumn) ReadFrom

func (c *NullableColumn) ReadFrom(rd *chproto.Reader, numRow int) error

func (*NullableColumn) ResetForWriting

func (c *NullableColumn) ResetForWriting(numRow int)

func (*NullableColumn) Set

func (c *NullableColumn) Set(v any)

func (*NullableColumn) Slice

func (c *NullableColumn) Slice(s, e int) any

func (*NullableColumn) Type

func (c *NullableColumn) Type() reflect.Type

func (*NullableColumn) Value

func (c *NullableColumn) Value() any

func (*NullableColumn) WriteTo

func (c *NullableColumn) WriteTo(wr *chproto.Writer) error

type NumericColumnOf

type NumericColumnOf[T constraints.Integer | constraints.Float] struct {
	ColumnOf[T]
}

func (NumericColumnOf[T]) ConvertAssign

func (c NumericColumnOf[T]) ConvertAssign(idx int, v reflect.Value) error

type Query

type Query interface {
	QueryAppender
	Operation() string
	GetModel() Model
	GetTableName() string
}

type QueryAppender

type QueryAppender interface {
	AppendQuery(fmter Formatter, b []byte) ([]byte, error)
}

type QueryWithArgs

type QueryWithArgs struct {
	Query string
	Args  []any
}

func SafeQuery

func SafeQuery(query string, args []any) QueryWithArgs

func UnsafeName

func UnsafeName(ident string) QueryWithArgs

func (QueryWithArgs) AppendQuery

func (q QueryWithArgs) AppendQuery(fmter Formatter, b []byte) ([]byte, error)

func (QueryWithArgs) IsEmpty

func (q QueryWithArgs) IsEmpty() bool

func (QueryWithArgs) IsZero

func (q QueryWithArgs) IsZero() bool

func (QueryWithArgs) Value

func (q QueryWithArgs) Value() Safe

type QueryWithSep

type QueryWithSep struct {
	QueryWithArgs
	Sep string
}

func SafeQueryWithSep

func SafeQueryWithSep(query string, args []any, sep string) QueryWithSep

type Safe

type Safe string

Safe represents a safe SQL query.

func (Safe) AppendQuery

func (s Safe) AppendQuery(fmter Formatter, b []byte) ([]byte, error)

type StringColumn

type StringColumn struct {
	ColumnOf[string]
}

func (*StringColumn) AppendValue

func (c *StringColumn) AppendValue(v reflect.Value)

func (StringColumn) ConvertAssign

func (c StringColumn) ConvertAssign(idx int, v reflect.Value) error

func (*StringColumn) ReadFrom

func (c *StringColumn) ReadFrom(rd *chproto.Reader, numRow int) error

func (*StringColumn) Type

func (c *StringColumn) Type() reflect.Type

func (*StringColumn) WriteTo

func (c *StringColumn) WriteTo(wr *chproto.Writer) error

type Table

type Table struct {
	Type reflect.Type

	ModelName string

	Name         string
	CHName       Safe
	CHInsertName Safe
	CHAlias      Safe
	CHEngine     string
	CHPartition  string

	Fields     []*Field // PKs + DataFields
	PKs        []*Field
	DataFields []*Field
	FieldMap   map[string]*Field
	// contains filtered or unexported fields
}

func TableForType

func TableForType(typ reflect.Type) *Table

func (*Table) AppendNamedArg

func (t *Table) AppendNamedArg(
	fmter Formatter, b []byte, name string, strct reflect.Value,
) ([]byte, bool)

func (*Table) Field

func (t *Table) Field(name string) (*Field, error)

func (*Table) HasAfterScanRowHook

func (t *Table) HasAfterScanRowHook() bool

func (*Table) IsColumnar

func (t *Table) IsColumnar() bool

func (*Table) NewColumn

func (t *Table) NewColumn(colName, colType string) *Column

func (*Table) String

func (t *Table) String() string

type TimeColumn

type TimeColumn struct {
	DateTimeColumn
}

func (*TimeColumn) ReadFrom

func (c *TimeColumn) ReadFrom(rd *chproto.Reader, numRow int) error

func (TimeColumn) WriteTo

func (c TimeColumn) WriteTo(wr *chproto.Writer) error

type UInt16Column

type UInt16Column struct {
	NumericColumnOf[uint16]
}

func (*UInt16Column) AppendValue

func (c *UInt16Column) AppendValue(v reflect.Value)

func (*UInt16Column) ReadFrom

func (c *UInt16Column) ReadFrom(rd *chproto.Reader, numRow int) error

func (*UInt16Column) Type

func (c *UInt16Column) Type() reflect.Type

func (*UInt16Column) WriteTo

func (c *UInt16Column) WriteTo(wr *chproto.Writer) error

type UInt32Column

type UInt32Column struct {
	NumericColumnOf[uint32]
}

func (*UInt32Column) AppendValue

func (c *UInt32Column) AppendValue(v reflect.Value)

func (*UInt32Column) ReadFrom

func (c *UInt32Column) ReadFrom(rd *chproto.Reader, numRow int) error

func (*UInt32Column) Type

func (c *UInt32Column) Type() reflect.Type

func (*UInt32Column) WriteTo

func (c *UInt32Column) WriteTo(wr *chproto.Writer) error

type UInt64Column

type UInt64Column struct {
	NumericColumnOf[uint64]
}

func (*UInt64Column) AppendValue

func (c *UInt64Column) AppendValue(v reflect.Value)

func (*UInt64Column) ReadFrom

func (c *UInt64Column) ReadFrom(rd *chproto.Reader, numRow int) error

func (*UInt64Column) Type

func (c *UInt64Column) Type() reflect.Type

func (*UInt64Column) WriteTo

func (c *UInt64Column) WriteTo(wr *chproto.Writer) error

type UInt8Column

type UInt8Column struct {
	NumericColumnOf[uint8]
}

func (*UInt8Column) AppendValue

func (c *UInt8Column) AppendValue(v reflect.Value)

func (*UInt8Column) ReadFrom

func (c *UInt8Column) ReadFrom(rd *chproto.Reader, numRow int) error

func (*UInt8Column) Type

func (c *UInt8Column) Type() reflect.Type

func (*UInt8Column) WriteTo

func (c *UInt8Column) WriteTo(wr *chproto.Writer) error

type UUID

type UUID [16]byte

type UUIDColumn

type UUIDColumn struct {
	ColumnOf[UUID]
}

TODO: rework to use []byte

func (*UUIDColumn) AppendValue

func (c *UUIDColumn) AppendValue(v reflect.Value)

func (UUIDColumn) ConvertAssign

func (c UUIDColumn) ConvertAssign(idx int, v reflect.Value) error

func (*UUIDColumn) ReadFrom

func (c *UUIDColumn) ReadFrom(rd *chproto.Reader, numRow int) error

func (UUIDColumn) Type

func (c UUIDColumn) Type() reflect.Type

func (UUIDColumn) WriteTo

func (c UUIDColumn) WriteTo(wr *chproto.Writer) error

type UnknownColumnError

type UnknownColumnError struct {
	Table  *Table
	Column string
}

func (*UnknownColumnError) Error

func (err *UnknownColumnError) Error() string

Jump to

Keyboard shortcuts

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