aboutsummaryrefslogtreecommitdiffstats
path: root/vendor/github.com/ClickHouse/ch-go/proto/col_uuid.go
blob: a27d3fb8a1fcea0bf5400b986cbf9b5cdf8e2bbd (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
package proto

import (
	"github.com/google/uuid"
)

// ColUUID is UUID column.
type ColUUID []uuid.UUID

// Compile-time assertions for ColUUID.
var (
	_ ColInput            = ColUUID{}
	_ ColResult           = (*ColUUID)(nil)
	_ Column              = (*ColUUID)(nil)
	_ ColumnOf[uuid.UUID] = (*ColUUID)(nil)
)

func (c ColUUID) Type() ColumnType         { return ColumnTypeUUID }
func (c ColUUID) Rows() int                { return len(c) }
func (c ColUUID) Row(i int) uuid.UUID      { return c[i] }
func (c *ColUUID) Reset()                  { *c = (*c)[:0] }
func (c *ColUUID) Append(v uuid.UUID)      { *c = append(*c, v) }
func (c *ColUUID) AppendArr(v []uuid.UUID) { *c = append(*c, v...) }