Versions in this module Expand all Collapse all v1 v1.0.1 Oct 12, 2024 Changes in this version + const AUTH_REQ_CRYPT + const AUTH_REQ_KRB4 + const AUTH_REQ_KRB5 + const AUTH_REQ_SCM + const AUTH_REQ_SSPI + const AuthReqGss + const AuthReqGssContinue + const AuthReqMd5 + const AuthReqMd5Sha256 + const AuthReqOk + const AuthReqPassword + const AuthReqSha256 + const AuthReqSm3 + const ClientEncoding + const DefaultClientEncoding + const Edebug + const Efatal + const Einfo + const Elog + const Enotice + const Epanic + const Ewarning + const LogLevelDebug + const LogLevelError + const LogLevelInfo + const LogLevelNone + const LogLevelTrace + const LogLevelWarn + const Md5Password + const PlainPassword + const ServerEncoding + const ServerVersion + const Sha256Password + const Sm3Password + const TimeZone + var ErrChannelAlreadyOpen = errors.New("pq: channel is already open") + var ErrChannelNotOpen = errors.New("pq: channel is not open") + var ErrCouldNotDetectUsername = errors.New("pq: Could not detect default username. Please provide one explicitly") + var ErrInFailedTransaction = errors.New("pq: Could not complete operation in a failed transaction") + var ErrNotSupported = errors.New("pq: Unsupported command") + var ErrSSLKeyHasWorldPermissions = errors.New(...) + var ErrSSLKeyUnknownOwnership = errors.New(...) + var ErrSSLNotSupported = errors.New("pq: SSL is not enabled on the server") + func Array(a interface{}) interface + func ConnectorNoticeHandler(c driver.Connector) func(*Error) + func ConnectorNotificationHandler(c driver.Connector) func(*Notification) + func CopyIn(table string, columns ...string) string + func CopyInSchema(schema, table string, columns ...string) string + func DeregisterTLSConfig(key string) + func DialOpen(d Dialer, dsn string) (_ driver.Conn, err error) + func EnableInfinityTs(negative time.Time, positive time.Time) + func FormatTimestamp(t time.Time) []byte + func Md5Sha256encode(password, random64code string, salt []byte) []byte + func NetworkAddress(host string, port uint16) (network, address string) + func NoticeHandler(c driver.Conn) func(*Error) + func Open(dsn string) (_ driver.Conn, err error) + func ParseTimestamp(currentLocation *time.Location, str string) (time.Time, error) + func ParseURL(url string) (string, error) + func ParseURLToMap(connString string) (map[string]string, error) + func QuoteIdentifier(name string) string + func QuoteLiteral(literal string) string + func RFC5802Algorithm(password string, random64code string, token string, serverSignature string, ...) []byte + func RegisterGSSProvider(newGssArg NewGSSFunc) + func RegisterTLSConfig(key string, config *tls.Config) error + func SetNoticeHandler(c driver.Conn, handler func(*Error)) + func SetNotificationHandler(c driver.Conn, handler func(*Notification)) + func ValidateConnectTargetSessionAttrsPrimary(cn *conn) error + func ValidateConnectTargetSessionAttrsReadOnly(cn *conn) error + func ValidateConnectTargetSessionAttrsReadWrite(cn *conn) error + func ValidateConnectTargetSessionAttrsStandby(cn *conn) error + func XorBetweenPassword(password1 []byte, password2 []byte, length int) []byte + type ArrayDelimiter interface + ArrayDelimiter func() string + type BoolArray []bool + func (a *BoolArray) Scan(src interface{}) error + func (a BoolArray) Value() (driver.Value, error) + type ByteaArray [][]byte + func (a *ByteaArray) Scan(src interface{}) error + func (a ByteaArray) Value() (driver.Value, error) + type Config struct + ConnectTimeout time.Duration + Database string + DialFunc DialFunc + Fallbacks []*FallbackConfig + GssAPIParams map[string]string + Host string + LogLevel LogLevel + Logger Logger + LookupFunc LookupFunc + Password string + Port uint16 + RuntimeParams map[string]string + TLSConfig *tls.Config + User string + ValidateConnect ValidateConnectFunc + func ParseConfig(connString string) (*Config, error) + func (c *Config) Copy() *Config + type Connector struct + func NewConnector(dsn string) (*Connector, error) + func NewConnectorConfig(config *Config) (*Connector, error) + func (c *Connector) Connect(ctx context.Context) (driver.Conn, error) + func (c *Connector) Driver() driver.Driver + type DialFunc func(ctx context.Context, network, addr string) (net.Conn, error) + type Dialer interface + Dial func(network, address string) (net.Conn, error) + DialTimeout func(network, address string, timeout time.Duration) (net.Conn, error) + type DialerContext interface + DialContext func(ctx context.Context, network, address string) (net.Conn, error) + type Driver struct + func (d Driver) Open(name string) (driver.Conn, error) + type Error struct + Code ErrorCode + Column string + Constraint string + DataTypeName string + Detail string + File string + Hint string + InternalPosition string + InternalQuery string + Line string + Message string + Position string + Routine string + Schema string + Severity string + Table string + Where string + func (err *Error) Fatal() bool + func (err *Error) Get(k byte) (v string) + func (err *Error) SQLState() string + func (err Error) Error() string + type ErrorClass string + func (ec ErrorClass) Name() string + type ErrorCode string + func (ec ErrorCode) Class() ErrorClass + func (ec ErrorCode) Name() string + func (ec ErrorCode) String() string + type EventCallbackType func(event ListenerEventType, err error) + type FallbackConfig struct + Host string + Port uint16 + TLSConfig *tls.Config + type Float32Array []float32 + func (a *Float32Array) Scan(src interface{}) error + func (a Float32Array) Value() (driver.Value, error) + type Float64Array []float64 + func (a *Float64Array) Scan(src interface{}) error + func (a Float64Array) Value() (driver.Value, error) + type GSS interface + Continue func(inToken []byte) (done bool, outToken []byte, err error) + GetInitToken func(host string, service string) ([]byte, error) + GetInitTokenFromSpn func(spn string) ([]byte, error) + type GenericArray struct + A interface{} + func (a GenericArray) Scan(src interface{}) error + func (a GenericArray) Value() (driver.Value, error) + type Int32Array []int32 + func (a *Int32Array) Scan(src interface{}) error + func (a Int32Array) Value() (driver.Value, error) + type Int64Array []int64 + func (a *Int64Array) Scan(src interface{}) error + func (a Int64Array) Value() (driver.Value, error) + type Listener struct + Notify chan *Notification + func NewDialListener(d Dialer, name string, minReconnectInterval time.Duration, ...) *Listener + func NewListener(name string, minReconnectInterval time.Duration, ...) *Listener + func (l *Listener) Close() error + func (l *Listener) Listen(channel string) error + func (l *Listener) NotificationChannel() <-chan *Notification + func (l *Listener) Ping() error + func (l *Listener) Unlisten(channel string) error + func (l *Listener) UnlistenAll() error + type ListenerConn struct + func NewListenerConn(name string, notificationChan chan<- *Notification) (*ListenerConn, error) + func (l *ListenerConn) Close() error + func (l *ListenerConn) Err() error + func (l *ListenerConn) ExecSimpleQuery(q string) (executed bool, err error) + func (l *ListenerConn) Listen(channel string) (bool, error) + func (l *ListenerConn) Ping() error + func (l *ListenerConn) Unlisten(channel string) (bool, error) + func (l *ListenerConn) UnlistenAll() (bool, error) + type ListenerEventType int + const ListenerEventConnected + const ListenerEventConnectionAttemptFailed + const ListenerEventDisconnected + const ListenerEventReconnected + type LogLevel int + func LogLevelFromString(s string) (LogLevel, error) + func (ll LogLevel) String() string + type Logger interface + Log func(ctx context.Context, level LogLevel, msg string, data map[string]interface{}) + var DefaultLogger Logger = NewPrintfLogger(LogLevelDebug) + func NewPrintfLogger(level LogLevel) Logger + type LookupFunc func(ctx context.Context, host string) (addrs []string, err error) + type NewGSSFunc func() (GSS, error) + type NoticeHandlerConnector struct + func ConnectorWithNoticeHandler(c driver.Connector, handler func(*Error)) *NoticeHandlerConnector + func (n *NoticeHandlerConnector) Connect(ctx context.Context) (driver.Conn, error) + type Notification struct + BePid int + Channel string + Extra string + type NotificationHandlerConnector struct + func ConnectorWithNotificationHandler(c driver.Connector, handler func(*Notification)) *NotificationHandlerConnector + func (n *NotificationHandlerConnector) Connect(ctx context.Context) (driver.Conn, error) + type NullTime struct + Time time.Time + Valid bool + func (nt *NullTime) Scan(value interface{}) error + func (nt NullTime) Value() (driver.Value, error) + type PGError interface + Error func() string + Fatal func() bool + Get func(k byte) (v string) + type StringArray []string + func (a *StringArray) Scan(src interface{}) error + func (a StringArray) Value() (driver.Value, error) + type ValidateConnectFunc func(conn *conn) error