ckgroup

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Sep 28, 2025 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ClickHouseClient

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

ClickHouseClient ClickHouse客户端

var CKCONN ClickHouseClient

func NewClickHouseClient

func NewClickHouseClient(config Config) (*ClickHouseClient, error)

NewClickHouseClient 创建新的ClickHouse客户端

func (*ClickHouseClient) BatchInsert

func (c *ClickHouseClient) BatchInsert(tableName string, data interface{}) error

BatchInsert 批量插入数据,支持nested结构

func (*ClickHouseClient) Close

func (c *ClickHouseClient) Close() error

Close 关闭连接

func (*ClickHouseClient) Count

func (c *ClickHouseClient) Count(tableName string, where string, args ...interface{}) (int64, error)

Count 获取表记录数

func (*ClickHouseClient) CreateDistributedTable

func (c *ClickHouseClient) CreateDistributedTable(distDB, localTable, desc string, cols []Column) error

func (*ClickHouseClient) CreateTable

func (c *ClickHouseClient) CreateTable(database, table, order, desc string, cols []Column) error

func (*ClickHouseClient) Exec

func (c *ClickHouseClient) Exec(query string, args ...interface{}) error

Exec 执行SQL语句

func (*ClickHouseClient) Query

func (c *ClickHouseClient) Query(query string, args ...interface{}) (*sql.Rows, error)

Query 执行查询

func (*ClickHouseClient) QueryRow

func (c *ClickHouseClient) QueryRow(query string, args ...interface{}) *sql.Row

QueryRow 执行单行查询

func (*ClickHouseClient) QueryToStruct

func (c *ClickHouseClient) QueryToStruct(dest interface{}, query string, args ...interface{}) error

QueryToStruct 查询并映射到结构体切片

type Column

type Column struct {
	Name string
	Type string
}

type Config

type Config struct {
	Hosts     string
	Database  string
	Username  string
	Password  string
	BatchSize int
	Debug     bool
}

Config 配置结构

Jump to

Keyboard shortcuts

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