Files
zeekay ef352c1051 debrand: rename the wire client name, prose and linter config
proto.Name is sent in ClientHello and lands in the server's system.query_log,
so it is wire visible; it now reads datastore/native and is covered by a test.
Verified against the live server: the handshake succeeds and the new name
appears in query_log.

goimports' local-prefixes still named the upstream module, so it was not
grouping this module's own imports.

Doc comments, the deprecated-error markers in proto/error_codes.go and the
package prose are swept. Dead references are removed rather than repointed:
go-faster.org/docs/clickhouse and the mangled Datastore/clickhouse-cpp link
both 404, and the list of other vendors' clients does not belong here.

Four things deliberately keep the vendor name, and CI records why:
LICENSE and AUTHORS are the copyright notices Apache-2.0 requires; db.system in
query.go is an OpenTelemetry enum whose registered value for this DBMS is fixed
by the specification, so emitting anything else would be non-conformant; and
README names clickhouse-local, which is genuinely the binary our own server
image ships.

Numeric error codes and protocol revision constants are untouched.
2026-07-26 11:50:36 -07:00

78 lines
1.2 KiB
Go

package proto
import (
"fmt"
"github.com/go-faster/errors"
)
// Nothing represents NULL value.
type Nothing struct{}
// ColNothing represents column of null values.
// Value is row count.
//
// https://docs.hanzo.ai/datastore
type ColNothing int
func (c *ColNothing) Append(_ Nothing) {
*c++
}
func (c *ColNothing) AppendArr(vs []Nothing) {
*c = ColNothing(int(*c) + len(vs))
}
func (c ColNothing) Row(i int) Nothing {
if i >= int(c) {
panic(fmt.Sprintf("[%d] of [%d]Nothing", i, c))
}
return Nothing{}
}
func (c ColNothing) Type() ColumnType {
return ColumnTypeNothing
}
func (c ColNothing) Rows() int {
return int(c)
}
func (c *ColNothing) DecodeColumn(r *Reader, rows int) error {
*c = ColNothing(rows)
if rows == 0 {
return nil
}
if _, err := r.ReadRaw(rows); err != nil {
return errors.Wrap(err, "read")
}
return nil
}
func (c *ColNothing) Reset() {
*c = 0
}
func (c *ColNothing) Nullable() *ColNullable[Nothing] {
return &ColNullable[Nothing]{
Values: c,
}
}
func (c *ColNothing) Array() *ColArr[Nothing] {
return &ColArr[Nothing]{
Data: c,
}
}
func (c ColNothing) EncodeColumn(b *Buffer) {
if c == 0 {
return
}
b.PutRaw(make([]byte, c))
}
func (c ColNothing) WriteColumn(w *Writer) {
w.ChainBuffer(c.EncodeColumn)
}