Files
native/proto/col_enum8_unsafe_gen.go
zeekay 765c3d0aa1 hanzo-ds/native: de-branded native protocol lib (fork of clickhouse ch-go v0.71.0)
Module path, package names, and identifiers de-branded to native/proto/compress/
pool/tracing. Server wire-protocol strings preserved. Vendored codec surface used
by hanzo-ds/go (proto + compress).
2026-07-10 13:10:07 -07:00

49 lines
985 B
Go

//go:build (amd64 || arm64 || riscv64) && !purego
// Code generated by ./cmd/ch-gen-col, DO NOT EDIT.
package proto
import (
"unsafe"
"github.com/go-faster/errors"
)
// DecodeColumn decodes Enum8 rows from *Reader.
func (c *ColEnum8) DecodeColumn(r *Reader, rows int) error {
if rows == 0 {
return nil
}
*c = append(*c, make([]Enum8, rows)...)
s := *(*slice)(unsafe.Pointer(c))
dst := *(*[]byte)(unsafe.Pointer(&s))
if err := r.ReadFull(dst); err != nil {
return errors.Wrap(err, "read full")
}
return nil
}
// EncodeColumn encodes Enum8 rows to *Buffer.
func (c ColEnum8) EncodeColumn(b *Buffer) {
v := c
if len(v) == 0 {
return
}
offset := len(b.Buf)
b.Buf = append(b.Buf, make([]byte, len(v))...)
s := *(*slice)(unsafe.Pointer(&v))
src := *(*[]byte)(unsafe.Pointer(&s))
dst := b.Buf[offset:]
copy(dst, src)
}
func (c ColEnum8) WriteColumn(w *Writer) {
v := c
if len(v) == 0 {
return
}
src := *(*[]byte)(unsafe.Pointer(&v))
w.ChainWrite(src)
}