clickhouse

package
v3.1.2 Latest Latest
Warning

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

Go to latest
Published: Jul 13, 2022 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewClient

func NewClient(config *Config) *query.QueryDb

New 新连接

Types

type Config

type Config struct {
	Username         string   //账号 root
	Password         string   //密码
	Addr             []string //ip:port
	Database         string   //连接数据库
	DialTimeout      string   //200ms
	OpenStrategy     string   //random/in_order (default random)
	Compress         bool     //enable lz4 compression
	MaxExecutionTime string
	MaxOpenConns     int           //连接池最多同时打开的连接数
	MaxIdleConns     int           //连接池里最大空闲连接数。必须要比maxOpenConns小
	MaxLifetime      time.Duration //连接池里面的连接最大存活时长
	MaxIdleTime      time.Duration //连接池里面的连接最大空闲时长
	DriverName       string
	DisableDebug     bool // 关闭 debug模式
	DisableMetric    bool // 关闭指标采集
	DisableTrace     bool // 关闭链路追踪
}

Config 数据库配置

func (*Config) URI

func (config *Config) URI() string

URI 构造数据库连接

Jump to

Keyboard shortcuts

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