2022-04-30 10:30:34 +03:00
|
|
|
//go:build !amd64 && !arm64
|
|
|
|
|
|
|
|
package chschema
|
|
|
|
|
|
|
|
import (
|
|
|
|
"github.com/uptrace/go-clickhouse/ch/chproto"
|
|
|
|
)
|
|
|
|
|
|
|
|
{{- range . }}
|
|
|
|
|
2023-01-21 12:14:00 +02:00
|
|
|
{{ if eq .Size 0 }} {{ continue }} {{ end }}
|
|
|
|
|
|
|
|
func (c *{{ .Name }}Column) ReadFrom(rd *chproto.Reader, numRow int) error {
|
|
|
|
c.AllocForReading(numRow)
|
2022-04-30 10:30:34 +03:00
|
|
|
|
|
|
|
for i := range c.Column {
|
2023-01-21 12:14:00 +02:00
|
|
|
n, err := rd.{{ .Name }}()
|
2022-04-30 10:30:34 +03:00
|
|
|
if err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
c.Column[i] = n
|
|
|
|
}
|
|
|
|
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
2023-01-21 12:14:00 +02:00
|
|
|
func (c *{{ .Name }}Column) WriteTo(wr *chproto.Writer) error {
|
2022-04-30 10:30:34 +03:00
|
|
|
for _, n := range c.Column {
|
2023-01-21 12:14:00 +02:00
|
|
|
wr.{{ .Name }}(n)
|
2022-04-30 10:30:34 +03:00
|
|
|
}
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
|
|
|
{{- end }}
|