clickhouse

package
v0.11.689 Latest Latest
Warning

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

Go to latest
Published: Jul 20, 2026 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IngestrTypeHints added in v0.11.681

func IngestrTypeHints() map[string]string

IngestrTypeHints maps ClickHouse-native column type names (and ClickHouse-specific aliases) to ingestr/dlt types used for --columns hints on seed and ingest assets.

Parameterized forms such as DateTime64(3), Decimal64(2), FixedString(16), Enum8('a' = 1), and Array(UInt64) resolve via their base name. Nullable(T) and LowCardinality(T) are peeled by pkg/python so the inner type is used.

Entries that also exist in the shared defaults intentionally override them when this destination is ClickHouse (e.g. int8 is Int8 here, not PostgreSQL bigint; time is the Int64 alias, not a time-of-day type).

func IngestrTypeWrappers added in v0.11.681

func IngestrTypeWrappers() map[string]bool

IngestrTypeWrappers are ClickHouse parameterized types whose inner type should be resolved for ingestr --columns hints (e.g. Nullable(DateTime64(3))).

func NewColumnCheckOperator

func NewColumnCheckOperator(manager config.ConnectionGetter) *ansisql.ColumnCheckOperator

Types

type AcceptedValuesCheck

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

func (*AcceptedValuesCheck) Check

type BasicOperator

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

func NewBasicOperator

func NewBasicOperator(conn config.ConnectionGetter, extractor query.QueryExtractor, materializer materializer, parser *sqlparser.SQLParser) *BasicOperator

func (BasicOperator) Run

func (BasicOperator) RunTask

type ClickHouseClient

type ClickHouseClient interface {
	RunQueryWithoutResult(ctx context.Context, query *query.Query) error
	Select(ctx context.Context, query *query.Query) ([][]interface{}, error)
	Ping(ctx context.Context) error
	SelectWithSchema(ctx context.Context, queryObj *query.Query) (*query.QueryResult, error)
}

type ClickHouseConfig

type ClickHouseConfig interface {
	ToClickHouseOptions() *click_house.Options
	GetIngestrURI() string
	GetDatabase() string
}

type Client

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

func NewClient

func NewClient(c ClickHouseConfig) (*Client, error)

func (*Client) BuildTableExistsQuery added in v0.11.296

func (c *Client) BuildTableExistsQuery(tableName string) (string, error)

func (*Client) GetColumns added in v0.11.247

func (c *Client) GetColumns(ctx context.Context, databaseName, tableName string) ([]*ansisql.DBColumn, error)

func (*Client) GetDatabaseSummary added in v0.11.242

func (c *Client) GetDatabaseSummary(ctx context.Context) (*ansisql.DBDatabase, error)

func (*Client) GetDatabases added in v0.11.247

func (c *Client) GetDatabases(ctx context.Context) ([]string, error)

func (*Client) GetIngestrURI

func (c *Client) GetIngestrURI() (string, error)

func (*Client) GetTables added in v0.11.247

func (c *Client) GetTables(ctx context.Context, databaseName string) ([]string, error)

func (*Client) IngestrTypeHints added in v0.11.681

func (c *Client) IngestrTypeHints() map[string]string

IngestrTypeHints implements the optional connection capability used by pkg/python when building ingestr --columns hints for this destination.

func (*Client) IngestrTypeWrappers added in v0.11.681

func (c *Client) IngestrTypeWrappers() map[string]bool

IngestrTypeWrappers implements the optional connection capability used by pkg/python when peeling destination-specific type wrappers.

func (*Client) Ping

func (c *Client) Ping(ctx context.Context) error

Test runs a simple query (SELECT 1) to validate the connection.

func (*Client) RunQueryWithoutResult

func (c *Client) RunQueryWithoutResult(ctx context.Context, query *query.Query) error

func (*Client) Select

func (c *Client) Select(ctx context.Context, q *query.Query) ([][]interface{}, error)

Select runs a query and returns the results.

func (*Client) SelectWithSchema

func (c *Client) SelectWithSchema(ctx context.Context, queryObj *query.Query) (*query.QueryResult, error)

type Config

type Config struct {
	Username string
	Password string
	Host     string
	Port     int
	Database string
	HTTPPort int
	Secure   *int
}

func (*Config) GetDatabase added in v0.11.296

func (c *Config) GetDatabase() string

func (*Config) GetIngestrURI

func (c *Config) GetIngestrURI() string

func (*Config) ToClickHouseOptions

func (c *Config) ToClickHouseOptions() *click_house.Options

type Materializer

type Materializer struct {
	MaterializationMap AssetMaterializationMap
	// contains filtered or unexported fields
}

The other packages all use a materializer that renders the query to a single string. Due to the quirks of athena we need to create a different materializer that returns a slice of strings, since athena server requires us to send separate batches for certain things.

func NewMaterializer

func NewMaterializer(fullRefresh bool) *Materializer

func (*Materializer) LogIfFullRefreshAndDDL added in v0.11.222

func (m *Materializer) LogIfFullRefreshAndDDL(writer interface{}, asset *pipeline.Asset) error

func (*Materializer) Render

func (m *Materializer) Render(asset *pipeline.Asset, query string) ([]string, error)

type MaterializerFunc

type MaterializerFunc func(task *pipeline.Asset, query string) ([]string, error)

type PatternCheck

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

func (*PatternCheck) Check

type Renderer

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

func NewRenderer

func NewRenderer(fullRefresh bool) *Renderer

func (*Renderer) Render

func (r *Renderer) Render(asset *pipeline.Asset, query string) (string, error)

type RowScanner

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

func (*RowScanner) Scan

func (s *RowScanner) Scan(src any) error

Jump to

Keyboard shortcuts

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