Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CLI ¶
type CLI struct {
// contains filtered or unexported fields
}
CLI PostgreSQL 交互式命令行客户端
func NewCLIWithConfig ¶
NewCLIWithConfig 使用配置创建 PostgreSQL CLI 实例
type Config ¶
type Config struct {
Host string
Port int
Username string
Password string
Database string
SSLMode string // SSL模式:disable/require/verify-ca/verify-full,默认 disable
ConnectTimeout time.Duration // 连接超时,默认 10s
StatementTimeout time.Duration // 语句超时,默认 0(无限制)
MaxOpenConns int // 最大连接数,默认 10
MaxIdleConns int // 最大空闲连接数,默认 5
ConnMaxLifetime time.Duration // 连接最大生命周期,默认 1h
ApplicationName string // 应用名称
SearchPath string // 搜索路径
TimeZone string // 时区
CustomParams string // 自定义参数,如 "param1=value1¶m2=value2"
}
Config PostgreSQL 连接配置
Click to show internal directories.
Click to hide internal directories.