Documentation
¶
Index ¶
- type ClickHouseClient
- func (c *ClickHouseClient) BatchInsert(tableName string, data interface{}) error
- func (c *ClickHouseClient) Close() error
- func (c *ClickHouseClient) Count(tableName string, where string, args ...interface{}) (int64, error)
- func (c *ClickHouseClient) CreateDistributedTable(distDB, localTable, desc string, cols []Column) error
- func (c *ClickHouseClient) CreateTable(database, table, order, desc string, cols []Column) error
- func (c *ClickHouseClient) Exec(query string, args ...interface{}) error
- func (c *ClickHouseClient) Query(query string, args ...interface{}) (*sql.Rows, error)
- func (c *ClickHouseClient) QueryRow(query string, args ...interface{}) *sql.Row
- func (c *ClickHouseClient) QueryToStruct(dest interface{}, query string, args ...interface{}) error
- type Column
- type Config
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) 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 查询并映射到结构体切片
Click to show internal directories.
Click to hide internal directories.