Versions in this module Expand all Collapse all v0 v0.1.1 Sep 30, 2026 v0.1.0 Sep 30, 2026 Changes in this version + const OIDBPChar + const OIDBool + const OIDBoolArray + const OIDBytea + const OIDCID + const OIDChar + const OIDDate + const OIDFloat4 + const OIDFloat8 + const OIDFloat8Array + const OIDInt2 + const OIDInt2Array + const OIDInt2Vector + const OIDInt4 + const OIDInt4Array + const OIDInt8 + const OIDInt8Array + const OIDInterval + const OIDJSON + const OIDJSONB + const OIDName + const OIDNameArray + const OIDNumeric + const OIDOID + const OIDOIDArray + const OIDOIDVector + const OIDText + const OIDTextArray + const OIDTimestamp + const OIDTimestampTZ + const OIDUUID + const OIDVarchar + const OIDVarcharArr + const OIDXID + var ErrConnBusy = errors.New("conn busy: close the previous Rows first") + var ErrConnClosed = errors.New("conn closed") + var ErrNoRows = errors.New("no rows in result set") + var ErrTooManyRows = errors.New("too many rows in result set") + var ErrTxClosed = errors.New("tx is closed") + var ErrTxCommitRollback = errors.New("commit unexpectedly resulted in rollback") + func CollectOneStruct[T any](rows *Rows) (T, error) + func CollectStructsByPos[T any](rows *Rows) ([]T, error) + func CollectStructs[T any](rows *Rows) ([]T, error) + func QuoteIdentifier(parts ...string) string + type AuthError struct + Err error + func (e *AuthError) Error() string + func (e *AuthError) Unwrap() error + type Column struct + Name string + TypeOID uint32 + type CommandTag string + func (t CommandTag) Command() string + func (t CommandTag) RowsAffected() int64 + func (t CommandTag) String() string + type Config struct + Database string + DialFunc func(ctx context.Context, network, addr string) (net.Conn, error) + Host string + Password string + Port int + RuntimeParams map[string]string + SSLMode string + SSLRootCert string + User string + func ParseConfig(connString string) (*Config, error) + func (c *Config) Addr() (network, addr string) + func (c *Config) Copy() *Config + type Conn struct + func Connect(ctx context.Context, connString string, opts ...Option) (*Conn, error) + func ConnectConfig(ctx context.Context, cfg *Config, opts ...Option) (*Conn, error) + func (c *Conn) Begin(ctx context.Context) (*Tx, error) + func (c *Conn) BeginTx(ctx context.Context, opts TxOptions) (*Tx, error) + func (c *Conn) Close() error + func (c *Conn) Config() *Config + func (c *Conn) Deallocate(ctx context.Context, name string) error + func (c *Conn) Exec(ctx context.Context, sql string, args ...any) (CommandTag, error) + func (c *Conn) IsClosed() bool + func (c *Conn) PID() uint32 + func (c *Conn) ParameterStatus(name string) string + func (c *Conn) Prepare(ctx context.Context, name, sql string) error + func (c *Conn) Query(ctx context.Context, sql string, args ...any) (*Rows, error) + func (c *Conn) QueryRow(ctx context.Context, sql string, args ...any) *Row + func (c *Conn) ServerVersion() string + func (c *Conn) SimpleQuery(ctx context.Context, sql string) ([]Result, error) + func (c *Conn) TxStatus() byte + type ConnectError struct + Addr string + Err error + func (e *ConnectError) Error() string + func (e *ConnectError) Unwrap() error + type Format int16 + const BinaryFormat + const TextFormat + type Numeric string + func (n Numeric) Float64() (float64, error) + func (n Numeric) MarshalJSON() ([]byte, error) + type Option func(*Config) + func LockTimeout(d time.Duration) Option + func ReadOnly() Option + func StatementTimeout(d time.Duration) Option + type PgError struct + Code string + Detail string + Hint string + Message string + Position int + Severity string + Where string + func (e *PgError) Error() string + type Pool struct + func NewPool(cfg PoolConfig) *Pool + func (p *Pool) Acquire(ctx context.Context) (*PoolConn, error) + func (p *Pool) BeginTx(ctx context.Context, opts TxOptions) (*Tx, error) + func (p *Pool) Close() + func (p *Pool) Config() *Config + func (p *Pool) Exec(ctx context.Context, sql string, args ...any) (CommandTag, error) + func (p *Pool) Query(ctx context.Context, sql string, args ...any) (*Rows, error) + func (p *Pool) QueryRow(ctx context.Context, sql string, args ...any) *Row + type PoolConfig struct + AfterConnect func(ctx context.Context, c *Conn) error + BeforeClose func(c *Conn) + Config *Config + MaxConnLifetime time.Duration + MaxConns int + type PoolConn struct + func (pc *PoolConn) Conn() *Conn + func (pc *PoolConn) Release() + type ProtocolError struct + Msg string + func (e *ProtocolError) Error() string + type QueryOption interface + func MaxRows(n int) QueryOption + type RawValue struct + Bytes []byte + Format Format + OID uint32 + func (v RawValue) IsNull() bool + func (v RawValue) String() string + type Result struct + Columns []Column + CommandTag CommandTag + Rows [][][]byte + type Row struct + func (r *Row) Scan(dest ...any) error + type Rows struct + func (r *Rows) Close() + func (r *Rows) Columns() []Column + func (r *Rows) CommandTag() CommandTag + func (r *Rows) Err() error + func (r *Rows) Next() bool + func (r *Rows) RawValues() [][]byte + func (r *Rows) Scan(dest ...any) error + func (r *Rows) Suspended() bool + func (r *Rows) Values() ([]any, error) + type TLSError struct + Err error + func (e *TLSError) Error() string + func (e *TLSError) Unwrap() error + type Tx struct + func (tx *Tx) Commit(ctx context.Context) error + func (tx *Tx) Conn() *Conn + func (tx *Tx) Exec(ctx context.Context, sql string, args ...any) (CommandTag, error) + func (tx *Tx) Query(ctx context.Context, sql string, args ...any) (*Rows, error) + func (tx *Tx) QueryRow(ctx context.Context, sql string, args ...any) *Row + func (tx *Tx) Rollback(ctx context.Context) error + type TxOptions struct + ReadOnly bool v0.0.1 Sep 29, 2026