Versions in this module Expand all Collapse all v1 v1.0.3 Feb 4, 2025 v1.0.2 Feb 4, 2025 Changes in this version + func NetworkAddress(host string, port uint16) (network, address string) + func RegisterGSSProvider(newGSSArg NewGSSFunc) + func SafeToRetry(err error) bool + func Timeout(err error) bool + func ValidateConnectTargetSessionAttrsPreferStandby(ctx context.Context, pgConn *PgConn) error + func ValidateConnectTargetSessionAttrsPrimary(ctx context.Context, pgConn *PgConn) error + func ValidateConnectTargetSessionAttrsReadOnly(ctx context.Context, pgConn *PgConn) error + func ValidateConnectTargetSessionAttrsReadWrite(ctx context.Context, pgConn *PgConn) error + func ValidateConnectTargetSessionAttrsStandby(ctx context.Context, pgConn *PgConn) error + type AfterConnectFunc func(ctx context.Context, pgconn *PgConn) error + type Batch struct + func (batch *Batch) ExecParams(sql string, paramValues [][]byte, paramOIDs []uint32, paramFormats []int16, ...) + func (batch *Batch) ExecPrepared(stmtName string, paramValues [][]byte, paramFormats []int16, ...) + type BuildFrontendFunc func(r io.Reader, w io.Writer) *pgproto3.Frontend + type CancelRequestContextWatcherHandler struct + CancelRequestDelay time.Duration + Conn *PgConn + DeadlineDelay time.Duration + func (h *CancelRequestContextWatcherHandler) HandleCancel(context.Context) + func (h *CancelRequestContextWatcherHandler) HandleUnwatchAfterCancel() + type CloseComplete struct + type CommandTag struct + func NewCommandTag(s string) CommandTag + func (ct CommandTag) Delete() bool + func (ct CommandTag) Insert() bool + func (ct CommandTag) RowsAffected() int64 + func (ct CommandTag) Select() bool + func (ct CommandTag) String() string + func (ct CommandTag) Update() bool + type Config struct + AfterConnect AfterConnectFunc + BuildContextWatcherHandler func(*PgConn) ctxwatch.Handler + BuildFrontend BuildFrontendFunc + ConnectTimeout time.Duration + Database string + DialFunc DialFunc + Fallbacks []*FallbackConfig + Host string + KerberosSpn string + KerberosSrvName string + LookupFunc LookupFunc + OnNotice NoticeHandler + OnNotification NotificationHandler + OnPgError PgErrorHandler + Password string + Port uint16 + RuntimeParams map[string]string + TLSConfig *tls.Config + User string + ValidateConnect ValidateConnectFunc + func ParseConfig(connString string) (*Config, error) + func ParseConfigWithOptions(connString string, options ParseConfigOptions) (*Config, error) + func (c *Config) Copy() *Config + type ConnectError struct + Config *Config + func (e *ConnectError) Error() string + func (e *ConnectError) Unwrap() error + type DeadlineContextWatcherHandler struct + Conn net.Conn + DeadlineDelay time.Duration + func (h *DeadlineContextWatcherHandler) HandleCancel(ctx context.Context) + func (h *DeadlineContextWatcherHandler) HandleUnwatchAfterCancel() + type DialFunc func(ctx context.Context, network, addr string) (net.Conn, error) + type FallbackConfig struct + Host string + Port uint16 + TLSConfig *tls.Config + type FieldDescription struct + DataTypeOID uint32 + DataTypeSize int16 + Format int16 + Name string + TableAttributeNumber uint16 + TableOID uint32 + TypeModifier int32 + 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 GetSSLPasswordFunc func(ctx context.Context) string + type HijackedConn struct + Config *Config + Conn net.Conn + CustomData map[string]any + Frontend *pgproto3.Frontend + PID uint32 + ParameterStatuses map[string]string + SecretKey uint32 + TxStatus byte + type LookupFunc func(ctx context.Context, host string) (addrs []string, err error) + type MultiResultReader struct + func (mrr *MultiResultReader) Close() error + func (mrr *MultiResultReader) NextResult() bool + func (mrr *MultiResultReader) ReadAll() ([]*Result, error) + func (mrr *MultiResultReader) ResultReader() *ResultReader + type NewGSSFunc func() (GSS, error) + type NotPreferredError struct + func (e *NotPreferredError) Error() string + func (e *NotPreferredError) SafeToRetry() bool + func (e *NotPreferredError) Unwrap() error + type Notice PgError + type NoticeHandler func(*PgConn, *Notice) + type Notification struct + Channel string + PID uint32 + Payload string + type NotificationHandler func(*PgConn, *Notification) + type ParseConfigError struct + ConnString string + func (e *ParseConfigError) Error() string + func (e *ParseConfigError) Unwrap() error + type ParseConfigOptions struct + GetSSLPassword GetSSLPasswordFunc + type PgConn struct + func Connect(ctx context.Context, connString string) (*PgConn, error) + func ConnectConfig(ctx context.Context, config *Config) (*PgConn, error) + func ConnectWithOptions(ctx context.Context, connString string, parseConfigOptions ParseConfigOptions) (*PgConn, error) + func Construct(hc *HijackedConn) (*PgConn, error) + func (pgConn *PgConn) CancelRequest(ctx context.Context) error + func (pgConn *PgConn) CheckConn() error + func (pgConn *PgConn) CleanupDone() chan (struct{}) + func (pgConn *PgConn) Close(ctx context.Context) error + func (pgConn *PgConn) Conn() net.Conn + func (pgConn *PgConn) CopyFrom(ctx context.Context, r io.Reader, sql string) (CommandTag, error) + func (pgConn *PgConn) CopyTo(ctx context.Context, w io.Writer, sql string) (CommandTag, error) + func (pgConn *PgConn) CustomData() map[string]any + func (pgConn *PgConn) Deallocate(ctx context.Context, name string) error + func (pgConn *PgConn) EscapeString(s string) (string, error) + func (pgConn *PgConn) Exec(ctx context.Context, sql string) *MultiResultReader + func (pgConn *PgConn) ExecBatch(ctx context.Context, batch *Batch) *MultiResultReader + func (pgConn *PgConn) ExecParams(ctx context.Context, sql string, paramValues [][]byte, paramOIDs []uint32, ...) *ResultReader + func (pgConn *PgConn) ExecPrepared(ctx context.Context, stmtName string, paramValues [][]byte, ...) *ResultReader + func (pgConn *PgConn) Frontend() *pgproto3.Frontend + func (pgConn *PgConn) Hijack() (*HijackedConn, error) + func (pgConn *PgConn) IsBusy() bool + func (pgConn *PgConn) IsClosed() bool + func (pgConn *PgConn) PID() uint32 + func (pgConn *PgConn) ParameterStatus(key string) string + func (pgConn *PgConn) Ping(ctx context.Context) error + func (pgConn *PgConn) Prepare(ctx context.Context, name, sql string, paramOIDs []uint32) (*StatementDescription, error) + func (pgConn *PgConn) ReceiveMessage(ctx context.Context) (pgproto3.BackendMessage, error) + func (pgConn *PgConn) SecretKey() uint32 + func (pgConn *PgConn) StartPipeline(ctx context.Context) *Pipeline + func (pgConn *PgConn) SyncConn(ctx context.Context) error + func (pgConn *PgConn) TxStatus() byte + func (pgConn *PgConn) WaitForNotification(ctx context.Context) error + type PgError struct + Code string + ColumnName string + ConstraintName string + DataTypeName string + Detail string + File string + Hint string + InternalPosition int32 + InternalQuery string + Line int32 + Message string + Position int32 + Routine string + SchemaName string + Severity string + SeverityUnlocalized string + TableName string + Where string + func ErrorResponseToPgError(msg *pgproto3.ErrorResponse) *PgError + func (pe *PgError) Error() string + func (pe *PgError) SQLState() string + type PgErrorHandler func(*PgConn, *PgError) bool + type Pipeline struct + func (p *Pipeline) Close() error + func (p *Pipeline) Flush() error + func (p *Pipeline) GetResults() (results any, err error) + func (p *Pipeline) SendDeallocate(name string) + func (p *Pipeline) SendFlushRequest() + func (p *Pipeline) SendPipelineSync() + func (p *Pipeline) SendPrepare(name, sql string, paramOIDs []uint32) + func (p *Pipeline) SendQueryParams(sql string, paramValues [][]byte, paramOIDs []uint32, paramFormats []int16, ...) + func (p *Pipeline) SendQueryPrepared(stmtName string, paramValues [][]byte, paramFormats []int16, ...) + func (p *Pipeline) Sync() error + type PipelineSync struct + type Result struct + CommandTag CommandTag + Err error + FieldDescriptions []FieldDescription + Rows [][][]byte + type ResultReader struct + func (rr *ResultReader) Close() (CommandTag, error) + func (rr *ResultReader) FieldDescriptions() []FieldDescription + func (rr *ResultReader) NextRow() bool + func (rr *ResultReader) Read() *Result + func (rr *ResultReader) Values() [][]byte + type StatementDescription struct + Fields []FieldDescription + Name string + ParamOIDs []uint32 + SQL string + type ValidateConnectFunc func(ctx context.Context, pgconn *PgConn) error Other modules containing this package github.com/mark5cinco/pgx/v5