Help us shape the future of Go! Take the 2026 Go Developer Survey

postgres

package
v1.2.2 Latest Latest
Warning

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

Go to latest
Published: Dec 1, 2025 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EscapeDSNValue

func EscapeDSNValue(value string) string

EscapeDSNValue 对 DSN 中的值进行安全转义。 如果值包含空格,它会用单引号包裹,并转义内部的单引号和反斜杠。

Types

type Config

type Config struct {
	Host           string
	Port           uint16
	User           string
	Password       string
	Database       string
	TimeZone       string
	ClientEncode   string
	ClientKeyPath  string
	ClientCertPath string
	CaCertPath     string
	ReadOnly       bool
	ConnParam      map[string]string //额外的连接参数
}

func (*Config) FormatDSN

func (cfg *Config) FormatDSN() string

func (*Config) MakeConfig

func (cfg *Config) MakeConfig(host, port, database, user, password string) bool

func (*Config) MakeSSLConfig

func (cfg *Config) MakeSSLConfig(host, port, database, user, password, clientKeyPath, clientCertPath, caCertPath string) bool

Jump to

Keyboard shortcuts

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