Documentation
¶
Overview ¶
Package clickhouse provides a ClickHouse client implementation
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrDestMustBePointerToSlice = errors.New("dest must be a pointer to a slice") ErrDataMustBeSlice = errors.New("data must be a slice") ErrClickHouseResponse = errors.New("clickhouse error") )
Define static errors
View Source
var (
ErrURLRequired = errors.New("URL is required")
)
Static errors for configuration validation
Functions ¶
func TableExists ¶
TableExists checks if a table exists in the given database
Types ¶
type AdminConfig ¶ added in v0.0.25
type AdminConfig struct {
Incremental AdminTableConfig `yaml:"incremental"`
Scheduled AdminTableConfig `yaml:"scheduled"`
}
AdminConfig contains configurations for different transformation type admin tables
type AdminTableConfig ¶ added in v0.0.25
AdminTableConfig represents the configuration for a type-specific admin table
type ClientInterface ¶
type ClientInterface interface {
// QueryOne executes a query and returns a single result
QueryOne(ctx context.Context, query string, dest interface{}) error
// QueryMany executes a query and returns multiple results
QueryMany(ctx context.Context, query string, dest interface{}) error
// Execute runs a query and returns the raw response body
Execute(ctx context.Context, query string) ([]byte, error)
// BulkInsert performs a bulk insert operation
BulkInsert(ctx context.Context, table string, data interface{}) error
// Start initializes the client
Start() error
// Stop closes the client
Stop() error
}
ClientInterface defines the methods for interacting with ClickHouse
type Config ¶
type Config struct {
URL string `yaml:"url" validate:"required,url"`
Cluster string `yaml:"cluster"`
LocalSuffix string `yaml:"localSuffix"`
QueryTimeout time.Duration `yaml:"queryTimeout"`
InsertTimeout time.Duration `yaml:"insertTimeout"`
Debug bool `yaml:"debug"`
KeepAlive time.Duration `yaml:"keepAlive"`
Admin AdminConfig `yaml:"admin"`
}
Config contains ClickHouse connection and cluster settings
func (*Config) SetDefaults ¶
func (c *Config) SetDefaults()
SetDefaults sets default values for the configuration
Click to show internal directories.
Click to hide internal directories.