package clickhouse_api

import "github.com/ClickHouse/clickhouse-go/v2/examples/clickhouse_api"

Index

Constants

const TestSet string = "examples_clickhouse_api"

Functions

func AppendStruct

func AppendStruct() error

func ArrayInsertRead

func ArrayInsertRead() error

func AsyncInsert

func AsyncInsert() error

func Auth

func Auth() error

func BatchInsert

func BatchInsert() error

func BatchWithReleaseConnection

func BatchWithReleaseConnection() error

func BindParameters

func BindParameters() error

func CheckMinServerVersion

func CheckMinServerVersion(conn driver.Conn, major, minor, patch uint64) bool

func ClientInfo

func ClientInfo() error

func ColumnInsert

func ColumnInsert() error

func Compress

func Compress() error

func Connect

func Connect() error

func ConvertedInsert

func ConvertedInsert() error

func CustomTypes

func CustomTypes() error

func DynamicExample

func DynamicExample() error

func DynamicScan

func DynamicScan() error

func Exec

func Exec() error

func ExternalData

func ExternalData() error

func GeoInsertRead

func GeoInsertRead() error

func GetNativeConnection

func GetNativeConnection(settings clickhouse.Settings, tlsConfig *tls.Config, compression *clickhouse.Compression) (driver.Conn, error)

func GetNativeConnectionWithOptions

func GetNativeConnectionWithOptions(settings clickhouse.Settings, tlsConfig *tls.Config, compression *clickhouse.Compression) (driver.Conn, error)

func GetNativeTestEnvironment

func GetNativeTestEnvironment() (clickhouse_tests.ClickHouseTestEnvironment, error)

func IterableOrderedMapInsertRead

func IterableOrderedMapInsertRead() error

func JSONFastStructExample

func JSONFastStructExample() error

func JSONPathsExample

func JSONPathsExample() error

func JSONStringExample

func JSONStringExample() error

func JSONStructExample

func JSONStructExample() error

func MapInsertRead

func MapInsertRead() error

func MultiHostRandomVersion

func MultiHostRandomVersion() error

func MultiHostRoundRobinVersion

func MultiHostRoundRobinVersion() error

func MultiHostVersion

func MultiHostVersion() error

func NestedFlattened

func NestedFlattened() error

func NestedUnFlattened

func NestedUnFlattened() error

func NullableInsertRead

func NullableInsertRead() error

func OpenTelemetry

func OpenTelemetry() error

func PingWithSettings

func PingWithSettings() error

func ProgressProfileLogs

func ProgressProfileLogs() error

func QueryRow

func QueryRow() error

func QueryRows

func QueryRows() error

func QueryWithParameters

func QueryWithParameters() error

func ReadWriteBigInt

func ReadWriteBigInt() error

func ReadWriteDecimal

func ReadWriteDecimal() error

func ResetRandSeed

func ResetRandSeed()

func SSLNoVerifyVersion

func SSLNoVerifyVersion() error

func SSLVersion

func SSLVersion() error

func ScanStruct

func ScanStruct() error

func SelectStruct

func SelectStruct() error

func SpecialBind

func SpecialBind() error

func TupleInsertRead

func TupleInsertRead() error

func UUIDInsertRead

func UUIDInsertRead() error

func UseContext

func UseContext() error

func VariantExample

func VariantExample() error

Types

type FastProduct

type FastProduct struct {
	ID        clickhouse.Dynamic `json:"id"`
	Name      string             `json:"name"`
	Tags      []string           `json:"tags"`
	Pricing   FastProductPricing `json:"pricing"`
	Metadata  map[string]any     `json:"metadata"`
	CreatedAt time.Time          `json:"created_at" chType:"DateTime64(3)"`
}

func NewExampleFastProduct

func NewExampleFastProduct() *FastProduct

func (*FastProduct) DeserializeClickHouseJSON

func (p *FastProduct) DeserializeClickHouseJSON(obj *clickhouse.JSON) error

DeserializeClickHouseJSON implements clickhouse.JSONDeserializer for faster struct scanning

func (*FastProduct) SerializeClickHouseJSON

func (p *FastProduct) SerializeClickHouseJSON() (*clickhouse.JSON, error)

SerializeClickHouseJSON implements clickhouse.JSONSerializer for faster struct appending

type FastProductPricing

type FastProductPricing struct {
	Price    int64  `json:",omitempty"`
	Currency string `json:",omitempty"`
}

type Product

type Product struct {
	ID        clickhouse.Dynamic     `json:"id"`
	Name      string                 `json:"name"`
	Tags      []string               `json:"tags"`
	Pricing   ProductPricing         `json:"pricing"`
	Metadata  map[string]interface{} `json:"metadata"`
	CreatedAt time.Time              `json:"created_at" chType:"DateTime64(3)"`
}

func NewExampleProduct

func NewExampleProduct() *Product

type ProductPricing

type ProductPricing struct {
	Price    int64  `json:",omitempty"`
	Currency string `json:",omitempty"`
}

type YourBatch

type YourBatch struct {
	// contains filtered or unexported fields
}

func New

func New(ctx context.Context, conn driver.Conn, insertStatement string) (*YourBatch, error)

func (*YourBatch) Append

func (b *YourBatch) Append(col1 uint64, col2 string) error

func (*YourBatch) Send

func (b *YourBatch) Send() error

Source Files

append_struct.go array.go async.go auth.go batch.go batch_release_connection.go big_int.go bind.go bind_special.go client_info.go columnar_insert.go compression.go connect.go connect_settings.go context.go custom_types.go decimal.go dynamic.go dynamic_scan_types.go exec.go external_data.go geo.go json_fast_structs.go json_paths.go json_strings.go json_structs.go map.go multi_host.go nested.go nullable.go open_telemetry.go progress.go query_parameters.go query_row.go query_rows.go scan_struct.go select_struct.go ssl.go ssl_no_verify.go tuple.go type_convert.go utils.go uuid.go variant.go

Version
v2.34.0 (latest)
Published
Apr 1, 2025
Platform
linux/amd64
Imports
24 packages
Last checked
1 hour ago

Tools for package owners.