Documentation ¶
Index ¶
- Constants
- Variables
- func IsEmpty(err error) bool
- type Balance
- type Conn
- type Logger
- type Opts
- type Pool
- func (d *Pool) Any(dst any, sql string, args ...any) error
- func (d *Pool) AnyAsync(dst any, sql string, args ...any) error
- func (d *Pool) Get(dst any, sql string, args ...any) error
- func (d *Pool) GetAsync(dst any, sql string, args ...any) error
- func (d *Pool) GetAsyncNamed(dst any, sql string, args map[string]any) error
- func (d *Pool) GetAsyncOpts(dst any, opts Opts) error
- func (d *Pool) GetNamed(dst any, sql string, args map[string]any) error
- func (d *Pool) GetOpts(dst any, opts Opts) error
- func (d *Pool) IsAlive() bool
- func (d *Pool) NewConn(mode connMode, pgConnString string) error
- func (d *Pool) NewConns(mode connMode, pgConnString ...string) error
- func (d *Pool) Ping(q *Conn) (err error)
- func (d *Pool) Select(dst any, sql string, args ...any) error
- func (d *Pool) SelectAsync(dst any, sql string, args ...any) error
- func (d *Pool) SelectAsyncNamed(dst any, sql string, args map[string]any) error
- func (d *Pool) SelectAsyncOpts(dst any, opts Opts) error
- func (d *Pool) SelectNamed(dst any, sql string, args map[string]any) error
- func (d *Pool) SelectOpts(dst any, opts Opts) error
- func (d *Pool) Start()
- func (d *Pool) Stat(q *Conn) *Stat
- func (d *Pool) StatMaster() *Stat
- func (d *Pool) StatPool() []*Stat
- func (d *Pool) StatPoolTotal() *Stat
- func (d *Pool) Stop()
- func (d *Pool) WAny(dst any, sql string, args ...any) error
- func (d *Pool) WExec(sql string, args ...any) error
- func (d *Pool) WExecNamed(sql string, args map[string]any) error
- func (d *Pool) WExecOpts(opts Opts) error
- func (d *Pool) WGet(dst any, sql string, args ...any) error
- func (d *Pool) WGetNamed(dst any, sql string, args map[string]any) error
- func (d *Pool) WGetOpts(dst any, opts Opts) error
- func (d *Pool) WSelect(dst any, sql string, args ...any) error
- func (d *Pool) WSelectNamed(dst any, sql string, args map[string]any) error
- func (d *Pool) WSelectOpts(dst any, opts Opts) error
- func (d *Pool) WithContext(ctx context.Context) *Pool
- func (d *Pool) WithDeadline(dur time.Time) *Pool
- func (d *Pool) WithTimeout(dur time.Duration) *Pool
- type Stat
Constants ¶
View Source
const ( ConnModeMaster connMode = iota ConnModeSync ConnModeAsync )
Variables ¶
View Source
var ErrNoRows = pgx.ErrNoRows
Functions ¶
Types ¶
type Pool ¶
type Pool struct { SrvMaster *Conn SrvSync []*Conn SrvAsync []*Conn Continues []string ContinuesTry []string TryOnError int TryOnSleep time.Duration Balance Balance PingTimout time.Duration PingTry int Debug bool // contains filtered or unexported fields }
func NewDefault ¶
func NewDefault() *Pool
func (*Pool) GetAsyncNamed ¶
func (*Pool) SelectAsyncNamed ¶
func (*Pool) SelectNamed ¶
func (*Pool) StatMaster ¶
func (*Pool) StatPoolTotal ¶
func (*Pool) WSelectNamed ¶
type Stat ¶
type Stat struct { ID string Mode connMode Host string Port uint16 AcquireCount int64 AcquireDuration time.Duration AcquiredConns int32 CanceledAcquireCount int64 ConstructingConns int32 EmptyAcquireCount int64 IdleConns int32 MaxConns int32 TotalConns int32 NewConnsCount int64 MaxLifetimeDestroyCount int64 MaxIdleDestroyCount int64 }
Click to show internal directories.
Click to hide internal directories.