clickhouse

package
v0.19.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 15, 2026 License: MIT Imports: 12 Imported by: 0

Documentation

Overview

Package clickhouse provides implementation of Clickhouse data warehouse

Index

Constants

View Source
const (
	// PrecisionMetadataKey is the metadata key used to store precision information for DateTime64 types
	PrecisionMetadataKey = "clickhouse.precision"
	// PrecisionMetadataValueSecond is the value indicating second precision for DateTime64 types
	PrecisionMetadataValueSecond = "0"
)
View Source
const ClickhouseMapperName = "clickhouse"

ClickhouseMapperName is the name of the ClickHouse type mapper

Variables

This section is empty.

Functions

func NewClickHouseQueryMapper

func NewClickHouseQueryMapper(opts ...Options) warehouse.QueryMapper

NewClickHouseQueryMapper creates a new ClickHouse query mapper.

func NewClickHouseTableDriver

func NewClickHouseTableDriver(chOptions *clickhouse.Options, database string, opts ...Options) warehouse.Driver

NewClickHouseTableDriver creates a new ClickHouse table driver.

func NewFieldTypeMapper

func NewFieldTypeMapper() warehouse.FieldTypeMapper[SpecificClickhouseType]

NewFieldTypeMapper creates a mapper that supports all ClickHouse types with proper circular dependency handling

Types

type Options

type Options func(*clickhouseQueryMapper)

Options represents a configuration option for ClickHouse query mapper.

func WithEngine

func WithEngine(engine string) Options

WithEngine sets the engine type for ClickHouse tables.

func WithIndexGranularity

func WithIndexGranularity(granularity int) Options

WithIndexGranularity sets the index granularity for ClickHouse tables.

func WithOrderBy

func WithOrderBy(orderBy []string) Options

WithOrderBy sets the order by columns for ClickHouse tables.

func WithPartitionBy

func WithPartitionBy(partitionBy string) Options

WithPartitionBy sets the partition expression for ClickHouse tables.

type SpecificClickhouseType

type SpecificClickhouseType struct {
	TypeAsString string
	FormatFunc   func(i any, m arrow.Metadata) (any, error)
}

SpecificClickhouseType represents a ClickHouse data type with its string representation and formatting function

func (SpecificClickhouseType) Format

func (t SpecificClickhouseType) Format(i any, m arrow.Metadata) (any, error)

Format formats a value according to the ClickHouse type's formatting function

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL