Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ConfigConnector ¶
type ConfigConnector pgx.ConnConfig
ConfigConnector implements the Connector interface for a `pgx.ConnConfig`.
type DBConnector ¶
DBConnector implements the Connector and Releaser interfaces for a *sql.DB.
func (*DBConnector) Connect ¶
func (db *DBConnector) Connect(context.Context) (*pgx.Conn, error)
Connect will return a *pgx.Conn from the underlying *sql.DB pool.
func (*DBConnector) Release ¶
func (db *DBConnector) Release(conn *pgx.Conn) error
Release will release a *pgx.Conn to the underlying *sql.DB pool.
type Error ¶
type Error struct { Code string Message string Detail string Hint string TableName string ConstraintName string Where string ColumnName string Position int // contains filtered or unexported fields }
Error represents a driver-agnostic SQL error.
type Listener ¶
type Listener struct {
// contains filtered or unexported fields
}
Listener will listen for NOTIFY commands on a set of channels.
func NewListener ¶
func NewListener(ctx context.Context, logger *log.Logger, db Connector, channels ...string) (*Listener, error)
NewListener will create and initialize a Listener which will automatically reconnect and listen to the provided channels.
func (*Listener) Notifications ¶
func (l *Listener) Notifications() <-chan *pgconn.Notification
Notifications returns the notification channel for this listener. Nil values will not be returned until the listener is closed.
type NullUUIDArray ¶ added in v0.28.0
func (*NullUUIDArray) Scan ¶ added in v0.28.0
func (s *NullUUIDArray) Scan(src interface{}) error
type Releaser ¶
type Releaser interface {
Release(*pgx.Conn) error
}
Releaser is an optional interface with a Release method to be called after a connection is closed.
type StringArray ¶
type StringArray []string
func (*StringArray) Scan ¶
func (s *StringArray) Scan(src interface{}) error