Documentation ¶
Overview ¶
Package pq is a pure Go Postgres driver for the database/sql package.
Package pq is a pure Go Postgres driver for the database/sql package. This module contains support for Postgres LISTEN/NOTIFY.
Index ¶
Constants ¶
View Source
const ( Efatal = "FATAL" Epanic = "PANIC" Ewarning = "WARNING" Enotice = "NOTICE" Edebug = "DEBUG" Einfo = "INFO" Elog = "LOG" )
View Source
const MaxReconnectDelay time.Duration = 15 * time.Minute
The maximum back-off for reconnection.
View Source
const MinReconnectDelay time.Duration = 3 * time.Second
The minimum/initial back-off for reconnection.
View Source
const Reconnected int = -1
Special bePid value issued on reconnection.
Variables ¶
View Source
var ( ErrSSLNotSupported = errors.New("pq: SSL is not enabled on the server") ErrNotSupported = errors.New("pq: invalid command") )
Functions ¶
func ParseURL ¶
ParseURL converts url to a connection string for driver.Open. Example:
"postgres://bob:secret@1.2.3.4:5432/mydb?sslmode=verify-full"
converts to:
"user=bob password=secret host=1.2.3.4 port=5432 dbname=mydb sslmode=verify-full"
A minimal example:
"postgres://"
This will be blank, causing driver.Open to use all of the defaults
Types ¶
type Listener ¶
type Listener struct {
// contains filtered or unexported fields
}
func NewListener ¶
type Notification ¶
type SimplePGError ¶
type SimplePGError struct {
// contains filtered or unexported fields
}
func (*SimplePGError) Error ¶
func (err *SimplePGError) Error() string
Click to show internal directories.
Click to hide internal directories.