Versions in this module Expand all Collapse all v0 v0.0.1 Oct 13, 2025 Changes in this version + var BinaryTypeAggregateFunction = [1]byte + var BinaryTypeArray = [1]byte + var BinaryTypeBFloat16 = [1]byte + var BinaryTypeBool = [1]byte + var BinaryTypeCustom = [1]byte + var BinaryTypeDate = [1]byte + var BinaryTypeDate32 = [1]byte + var BinaryTypeDateTime = [1]byte + var BinaryTypeDateTime64 = [1]byte + var BinaryTypeDateTime64WithTimeZone = [1]byte + var BinaryTypeDateTimeWithTimeZone = [1]byte + var BinaryTypeDecimal128 = [1]byte + var BinaryTypeDecimal256 = [1]byte + var BinaryTypeDecimal32 = [1]byte + var BinaryTypeDecimal64 = [1]byte + var BinaryTypeDynamic = [1]byte + var BinaryTypeEnum16 = [1]byte + var BinaryTypeEnum8 = [1]byte + var BinaryTypeFixedString = [1]byte + var BinaryTypeFloat32 = [1]byte + var BinaryTypeFloat64 = [1]byte + var BinaryTypeFunction = [1]byte + var BinaryTypeIPv4 = [1]byte + var BinaryTypeIPv6 = [1]byte + var BinaryTypeInt128 = [1]byte + var BinaryTypeInt16 = [1]byte + var BinaryTypeInt256 = [1]byte + var BinaryTypeInt32 = [1]byte + var BinaryTypeInt64 = [1]byte + var BinaryTypeInt8 = [1]byte + var BinaryTypeInterval = [1]byte + var BinaryTypeJSON = [1]byte + var BinaryTypeLowCardinality = [1]byte + var BinaryTypeMap = [1]byte + var BinaryTypeNested = [1]byte + var BinaryTypeNothing = [1]byte + var BinaryTypeNullable = [1]byte + var BinaryTypeSet = [1]byte + var BinaryTypeSimpleAggregateFunction = [1]byte + var BinaryTypeString = [1]byte + var BinaryTypeTime = [1]byte + var BinaryTypeTime64 = [1]byte + var BinaryTypeTuple = [1]byte + var BinaryTypeTupleNamed = [1]byte + var BinaryTypeUInt128 = [1]byte + var BinaryTypeUInt16 = [1]byte + var BinaryTypeUInt256 = [1]byte + var BinaryTypeUInt32 = [1]byte + var BinaryTypeUInt64 = [1]byte + var BinaryTypeUInt8 = [1]byte + var BinaryTypeUUID = [1]byte + var BinaryTypeVariant = [1]byte + var NotImplementedError = errors.New("not implemented") + func BenchmarkType[T any](b *testing.B, tp Type[T], value T) + func Eq(a, b Any) bool + func ExecLocal(query string) ([]byte, error) + func NewInvalidTypeError(msg string) error + func Scan[V any](r *FormatReader, tp Type[V], v *V) error + func SetGlobalDiscovery(...) + func StringEncode(s string) []byte + func StringWrite(w Writer, value string) error + func TestType[T any](t *testing.T, tp Type[T], value T, query string) + func VarintEncode(x uint64) []byte + func VarintRead(r Reader) (uint64, error) + func VarintWrite(w Writer, x uint64) error + func WithDSN(dsn string) dsnOption + func WithDatabase(database string) paramOption + func WithExternalData(name string, cb func(w *FormatWriter) error, opts ...ExternalDataOption) externalData + func WithHeader(name, value string) headerOption + func WithParam(name, value string) paramOption + func WithUseBinaryHeader(value bool) useBinaryHeaderType + func Write[V any](w *FormatWriter, tp Type[V], value V) error + type Any interface + Binary func() []byte + ID func() uint64 + ScanAny func(r Reader, v any) error + String func() string + WriteAny func(w Writer, v any) error + func DecodeBinaryType(r Reader) (Any, error) + func DecodeStringType(t string) (Any, error) + type BaseType interface + Binary func() []byte + Scan func(r Reader, v *T) error + String func() string + Write func(w Writer, v T) error + type Client interface + Close func() error + Exec func(ctx context.Context, query string, options ...ExecOption) error + Insert func(ctx context.Context, table string, options ...InsertOption) error + Select func(ctx context.Context, query string, options ...SelectOption) error + func NewClient(ctx context.Context, options ...ClientOption) Client + type ClientMethod int + const ClientMethodExecute + const ClientMethodInsert + const ClientMethodSelect + type ClientOption interface + func WithDiscovery(...) ClientOption + func WithHTTPClient(httpClient *http.Client) ClientOption + type Column struct + func C(name string, tp Any) Column + func WithColumn(name string, tp Any) Column + func (c Column) Name() string + func (c Column) String() string + func (c Column) Type() Any + type Columns struct + func (c Columns) At(i int) Column + func (c Columns) Len() int + type DiscoveryCtx struct + Method ClientMethod + type ExecOption interface + type ExternalDataOption interface + type Format int + const RowBinary + const RowBinaryWithNames + const RowBinaryWithNamesAndTypes + func (f Format) Eq(other Format) bool + func (f Format) In(other ...Format) bool + func (f Format) String() string + type FormatOption interface + type FormatReader struct + func NewFormatReader(wrap io.Reader, opts ...FormatOption) *FormatReader + func (r *FormatReader) Column(i int) (Column, error) + func (r *FormatReader) Columns() (*Columns, error) + func (r *FormatReader) Err() error + func (r *FormatReader) Next() bool + func (r *FormatReader) Scan(dest ...any) error + type FormatWriter struct + func NewFormatWriter(wrap io.Writer, opts ...FormatOption) *FormatWriter + func (w *FormatWriter) Err() error + func (w *FormatWriter) Format() Format + func (w *FormatWriter) Structure() string + func (w *FormatWriter) WriteAny(values ...any) error + func (w *FormatWriter) WriteHeader() error + type InsertOption interface + func WithBodyWriter(bw func(w io.Writer) error) InsertOption + func WithFormatWriter(fw func(w *FormatWriter) error) InsertOption + type InvalidTypeError struct + Msg string + func (e InvalidTypeError) Error() string + type KV struct + func NewKV[K comparable, V any]() *KV[K, V] + func (kv *KV[K, V]) Append(key K, value V) *KV[K, V] + func (kv *KV[K, V]) Delete(key K) *KV[K, V] + func (kv *KV[K, V]) Each(f func(key K, value V) error) error + func (kv *KV[K, V]) Get(key K) (V, bool) + func (kv *KV[K, V]) Len() int + func (kv *KV[K, V]) Reset() *KV[K, V] + func (kv *KV[K, V]) Set(key K, value V) *KV[K, V] + type PreType interface + ScanAny func(r Reader, v any) error + WriteAny func(w Writer, v any) error + func WrapAny[T any](tp BaseType[T]) PreType[T] + type Reader interface + Discard func(n int) (discarded int, err error) + Peek func(n int) ([]byte, error) + func NewReader(r io.Reader) Reader + type SelectOption interface + func WithBodyReader(cb func(r io.Reader) error) SelectOption + func WithFormatReader(cb func(r *FormatReader) error) SelectOption + type TestClient struct + func NewTestClient(ctx context.Context, dsn string, options ...ClientOption) *TestClient + func (tc *TestClient) Close() error + func (tc *TestClient) Database() string + type Type interface + ID func() uint64 + var Bool Type[bool] = MakeTypeWrapAny[bool](typeBool{}) + var Date Type[ValueDate] = MakeTypeWrapAny[ValueDate](typeDate{}) + var Date32 Type[ValueDate] = MakeTypeWrapAny[ValueDate](typeDate32{}) + var DateTime Type[time.Time] = MakeTypeWrapAny[time.Time](typeDateTime{}) + var Float32 Type[float32] = MakeTypeWrapAny[float32](typeFloat32{}) + var Float64 Type[float64] = MakeTypeWrapAny[float64](typeFloat64{}) + var IPv4 Type[[4]byte] = MakeTypeWrapAny[[4]byte](typeIPv4{}) + var IPv6 Type[[16]byte] = MakeTypeWrapAny[[16]byte](typeIPv6{}) + var Int16 Type[int16] = MakeTypeWrapAny[int16](typeInt16{}) + var Int32 Type[int32] = MakeTypeWrapAny[int32](typeInt32{}) + var Int64 Type[int64] = MakeTypeWrapAny[int64](typeInt64{}) + var Int8 Type[int8] = MakeTypeWrapAny[int8](typeInt8{}) + var IntervalDay Type[int64] = MakeTypeWrapAny[int64](typeInterval{ ... }) + var IntervalHour Type[int64] = MakeTypeWrapAny[int64](typeInterval{ ... }) + var IntervalMicrosecond Type[int64] = MakeTypeWrapAny[int64](typeInterval{ ... }) + var IntervalMillisecond Type[int64] = MakeTypeWrapAny[int64](typeInterval{ ... }) + var IntervalMinute Type[int64] = MakeTypeWrapAny[int64](typeInterval{ ... }) + var IntervalMonth Type[int64] = MakeTypeWrapAny[int64](typeInterval{ ... }) + var IntervalNanosecond Type[int64] = MakeTypeWrapAny[int64](typeInterval{ ... }) + var IntervalQuarter Type[int64] = MakeTypeWrapAny[int64](typeInterval{ ... }) + var IntervalSecond Type[int64] = MakeTypeWrapAny[int64](typeInterval{ ... }) + var IntervalWeek Type[int64] = MakeTypeWrapAny[int64](typeInterval{ ... }) + var IntervalYear Type[int64] = MakeTypeWrapAny[int64](typeInterval{ ... }) + var Nothing Type[any] = MakeTypeWrapAny[any](typeNothing{}) + var Point Type[[]any] = Custom("Point", TupleAny(Float64, Float64)) + var String Type[string] = MakeTypeWrapAny[string](typeString{}) + var StringBytes Type[[]byte] = MakeTypeWrapAny[[]byte](typeStringBytes{}) + var UInt16 Type[uint16] = MakeTypeWrapAny[uint16](typeUInt16{}) + var UInt32 Type[uint32] = MakeTypeWrapAny[uint32](typeUInt32{}) + var UInt64 Type[uint64] = MakeTypeWrapAny[uint64](typeUInt64{}) + var UInt8 Type[uint8] = MakeTypeWrapAny[uint8](typeUInt8{}) + var UUID Type[uuid.UUID] = MakeTypeWrapAny[uuid.UUID](typeUUID{}) + func ArrayAny(valueType Any) Type[[]any] + func Array[V any](valueType Type[V]) Type[[]V] + func Custom[T any](name string, base Type[T]) Type[T] + func DateTime64(p uint8) Type[time.Time] + func DateTime64TZ(p uint8, tz string) Type[time.Time] + func DateTimeTZ(tz string) Type[time.Time] + func Decimal(precision uint8, scale uint8) Type[decimal.Decimal] + func Decimal128(precision uint8, scale uint8) Type[decimal.Decimal] + func Decimal256(precision uint8, scale uint8) Type[decimal.Decimal] + func Decimal32(precision uint8, scale uint8) Type[decimal.Decimal] + func Decimal64(precision uint8, scale uint8) Type[decimal.Decimal] + func Dynamic(maxTypes uint8, knownTypes ...Any) Type[Value] + func Enum16(v map[string]int16) Type[string] + func Enum8(v map[string]int8) Type[string] + func FixedString(length int) Type[[]byte] + func Invalid[T any](msg string) Type[T] + func LowCardinalityAny(valueType Any) Type[any] + func LowCardinality[V any](valueType Type[V]) Type[V] + func MakeTypeWrapAny[T any](tp BaseType[T]) Type[T] + func MakeType[T any](tp PreType[T]) Type[T] + func MapAny(keyType Any, valueType Any) Type[map[any]any] + func MapKV[K comparable, V any](keyType Type[K], valueType Type[V]) Type[*KV[K, V]] + func Map[K comparable, V any](keyType Type[K], valueType Type[V]) Type[map[K]V] + func NullableAny(valueType Any) Type[*any] + func Nullable[V any](valueType Type[V]) Type[*V] + func TupleAny(valueTypes ...Any) Type[[]any] + func TupleNamedAny(columns ...Column) Type[[]any] + func Variant(valueTypes ...Any) Type[Value] + type TypeMismatchError struct + ActualType string + ExpectedType string + func (e TypeMismatchError) Error() string + type Value struct + Type Any + Value any + func (v Value) String() string + type ValueDate struct + Day uint8 + Month uint8 + Year uint16 + type Writer interface + Buffer func() []byte + func NewWriter(w io.Writer) Writer