Documentation ¶
Index ¶
- Constants
- func NewBlocksPrinter(balanceRow int) *blocksPrinter
- func WriteBlockToEncoder(encoder *ch_encoding.Encoder, b *Block) error
- func WriteClientInfo(encoder *ch_encoding.Encoder) (err error)
- type Block
- func NewBlock(colNames []string, colTypes []column.CHColumnType, numRows int) (*Block, error)
- func NewBlockWithLocation(colNames []string, colTypes []column.CHColumnType, numRows int, ...) (*Block, error)
- func ReadBlockFromDecoder(decoder *ch_encoding.Decoder) (*Block, error)
- func ReadBlockFromDecoderWithLocation(decoder *ch_encoding.Decoder, location *time.Location) (*Block, error)
- func (b *Block) Close() error
- func (b *Block) ColumnNames() []string
- func (b *Block) NewStringFrame() [][]string
- func (b *Block) NewValuesFrame() [][]interface{}
- func (b *Block) PrettyFmtBuild(builder *strings.Builder)
- func (b *Block) ReadFromColumnTexts(columnTexts [][]string) (rowsRead, columnsRead int, err error)
- func (b *Block) ReadFromColumnValues(colValues [][]interface{}) (rowsRead, columnsRead int, err error)
- func (b *Block) StructureCopy(numRows int) *Block
- func (b *Block) WriteRowToStrings(record []string, row int)
- func (b *Block) WriteRowToValues(record []interface{}, row int)
- func (b *Block) WriteToStrings(frame [][]string)
- func (b *Block) WriteToStringsV2(frame [][]string)
- func (b *Block) WriteToValues(values [][]interface{})
- func (b *Block) WriteValuesAsString(frame [][]interface{})
- type ServerInfo
Constants ¶
const ( //ClickHouseRevision = 54213 ClickHouseRevision = 54406 //To receive server logs, we have to update the client revision //ClickHouseRevision = protocol.DBMS_MIN_REVISION_WITH_CLIENT_WRITE_INFO //To receive TableColumn Metadata which is being expected by clickhouse-client //ClickHouseDBMSVersionMajor = 1 ClickHouseDBMSVersionMajor = 0 ClickHouseDBMSVersionMinor = 1 )
const ClientName = "Enhanced Golang SQLDriver"
Variables ¶
This section is empty.
Functions ¶
func NewBlocksPrinter ¶
func NewBlocksPrinter(balanceRow int) *blocksPrinter
NewBlocksPrinter creates a new blockPrinter instance which used to print blocks balanceRow is the number of rows you want to print for the query If no more balanceRow, block data won't be printed Example usage: var sb strings.Builder printer := NewBlocksPrinter(100) printer.Print(block1, &sb) printer.Print(block2, &sb) fmt.Println(sb.String())
func WriteBlockToEncoder ¶
func WriteBlockToEncoder(encoder *ch_encoding.Encoder, b *Block) error
func WriteClientInfo ¶
func WriteClientInfo(encoder *ch_encoding.Encoder) (err error)
Types ¶
type Block ¶
type Block struct { NumColumns int NumRows int Columns []*column.CHColumn // contains filtered or unexported fields }
func NewBlockWithLocation ¶
func ReadBlockFromDecoder ¶
func ReadBlockFromDecoder(decoder *ch_encoding.Decoder) (*Block, error)
func (*Block) ColumnNames ¶
func (*Block) NewStringFrame ¶
NewStringFrame returns an empty 2 dimensional string with dimensions same as the NumRows and NumColumns of the block.
func (*Block) NewValuesFrame ¶
func (b *Block) NewValuesFrame() [][]interface{}
NewValuesFrame returns an empty 2 dimensional interface with dimensions same as the NumRows and NumColumns of the block.
func (*Block) PrettyFmtBuild ¶
func (*Block) ReadFromColumnTexts ¶
ReadFromColumnTexts attempts to read columnTexts into current block. return numbers of rows read, columns read and error if any. if err occurs during read, return the first total num of rows before error occur for that column instead.
func (*Block) ReadFromColumnValues ¶
func (*Block) StructureCopy ¶
StructureCopy copies the metadata of Block, with n rows
func (*Block) WriteRowToStrings ¶
func (*Block) WriteRowToValues ¶
func (*Block) WriteToStrings ¶
WriteToStrings attempts to read to dataframe, panics if numRows and numCols exceed the dimension of dataframe. Callers are expected to check dimension of dataframe passed in.
func (*Block) WriteToStringsV2 ¶
WriteToStringsV2 is similar to WriteToStrings but using the boundaries of the given frame instead of boundaries of block.
func (*Block) WriteToValues ¶
func (b *Block) WriteToValues(values [][]interface{})
func (*Block) WriteValuesAsString ¶
func (b *Block) WriteValuesAsString(frame [][]interface{})
type ServerInfo ¶
type ServerInfo struct { Name string Revision uint64 MinorVersion uint64 MajorVersion uint64 Timezone *time.Location //Additional information since we upgraded the client revision number to 54406 (DBMS_MIN_REVISION_WITH_SERVER_LOGS) DisplayName string VersionPatch uint64 }
func ReadServerInfo ¶
func ReadServerInfo(decoder *ch_encoding.Decoder) (*ServerInfo, error)
func (*ServerInfo) String ¶
func (s *ServerInfo) String() string