Skip to content

Commit 0079bea

Browse files
authored
Merge pull request #277 from ClickHouse/docs/readme-enums
docs(readme): add enums section
2 parents dc42ac5 + ff253ac commit 0079bea

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

README.md

+15
Original file line numberDiff line numberDiff line change
@@ -298,6 +298,21 @@ colV.Reset()
298298
* Point
299299
* Nothing, Interval
300300

301+
## Enums
302+
303+
You can use automatic enum inference in `proto.ColEnum`, this will come with some performance penalty.
304+
305+
To use `proto.ColEnum8` and `proto.ColEnum16`, you need to explicitly provide DDL for them via `proto.Wrap`:
306+
307+
```go
308+
var v proto.ColEnum8
309+
310+
const ddl = `'Foo'=1, 'Bar'=2, 'Baz'=3`
311+
input := []proto.InputColumn{
312+
{Name: "v", Data: proto.Wrap(&v, ddl)},
313+
}
314+
```
315+
301316
## Generics
302317

303318
Most columns implement [proto.ColumnOf\[T\]](https://pkg.go.dev/github.com/ClickHouse/ch-go/proto#ColumnOf) generic constraint:

0 commit comments

Comments
 (0)