aboutsummaryrefslogtreecommitdiffstats
path: root/vendor/github.com/ClickHouse/clickhouse-go/clickhouse_read_block.go
blob: e9a3384dce043a655f8d0cf3bcdde7cea42bb0ce (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
package clickhouse

import (
	"github.com/ClickHouse/clickhouse-go/lib/data"
)

func (ch *clickhouse) readBlock() (*data.Block, error) {
	if _, err := ch.decoder.String(); err != nil { // temporary table
		return nil, err
	}

	ch.decoder.SelectCompress(ch.compress)
	var block data.Block
	if err := block.Read(&ch.ServerInfo, ch.decoder); err != nil {
		return nil, err
	}
	ch.decoder.SelectCompress(false)
	return &block, nil
}