aboutsummaryrefslogtreecommitdiffstats
path: root/vendor/github.com/ClickHouse/ch-go/proto/col_uint8_safe_gen.go
blob: ec5ff19041f83020742e1d34921459b2fc40aa48 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
// Code generated by ./cmd/ch-gen-col, DO NOT EDIT.

package proto

import (
	"encoding/binary"

	"github.com/go-faster/errors"
)

var _ = binary.LittleEndian // clickHouse uses LittleEndian

// DecodeColumn decodes UInt8 rows from *Reader.
func (c *ColUInt8) DecodeColumn(r *Reader, rows int) error {
	if rows == 0 {
		return nil
	}
	data, err := r.ReadRaw(rows)
	if err != nil {
		return errors.Wrap(err, "read")
	}
	*c = append(*c, data...)
	return nil
}

// EncodeColumn encodes UInt8 rows to *Buffer.
func (c ColUInt8) EncodeColumn(b *Buffer) {
	v := c
	if len(v) == 0 {
		return
	}
	b.Buf = append(b.Buf, v...)
}