Versions in this module Expand all Collapse all v3 v3.0.0 Aug 17, 2022 Changes in this version + var Discard discardLoader + var ErrMultiRows = errorf("pg: multiple rows in result set") + var ErrNoRows = errorf("pg: no rows in result set") + var ErrSSLNotSupported = errorf("pg: SSL is not enabled on the server") + func AppendQ(dst []byte, src string, params ...interface{}) ([]byte, error) + func Decode(dst interface{}, b []byte) error + func DecodeValue(v reflect.Value, b []byte) error + type Collection interface + NewRecord func() interface{} + type ColumnLoader interface + LoadColumn func(colIdx int, colName string, b []byte) error + func LoadInto(values ...interface{}) ColumnLoader + func NewColumnLoader(dst interface{}) (ColumnLoader, error) + type DB struct + func Connect(opt *Options) *DB + func (db *DB) Begin() (*Tx, error) + func (db *DB) Close() error + func (db *DB) CopyFrom(r io.Reader, q string, args ...interface{}) (Result, error) + func (db *DB) CopyTo(w io.WriteCloser, q string, args ...interface{}) (Result, error) + func (db *DB) Exec(q string, args ...interface{}) (res Result, err error) + func (db *DB) ExecOne(q string, args ...interface{}) (Result, error) + func (db *DB) Listen(channels ...string) (*Listener, error) + func (db *DB) Options() *Options + func (db *DB) Prepare(q string) (*Stmt, error) + func (db *DB) Query(coll interface{}, q string, args ...interface{}) (res Result, err error) + func (db *DB) QueryOne(record interface{}, q string, args ...interface{}) (Result, error) + func (db *DB) RunInTransaction(fn func(*Tx) error) error + func (db *DB) WithTimeout(d time.Duration) *DB + type Error interface + Field func(byte) string + type F string + func (f F) AppendQuery(dst []byte) []byte + type IntSet map[int64]struct + func (set *IntSet) NewRecord() interface{} + func (setptr *IntSet) LoadColumn(colIdx int, colName string, b []byte) error + type IntegrityError struct + func (err IntegrityError) Error() string + func (err IntegrityError) Field(k byte) string + type Ints []int64 + func (ints *Ints) LoadColumn(colIdx int, colName string, b []byte) error + func (ints *Ints) NewRecord() interface{} + func (ints Ints) AppendQuery(dst []byte) []byte + type Listener struct + func (l *Listener) Close() error + func (l *Listener) Listen(channels ...string) error + func (l *Listener) Receive() (channel string, payload string, err error) + func (l *Listener) ReceiveTimeout(readTimeout time.Duration) (channel, payload string, err error) + type Model struct + func NewModel(vi interface{}, name string) *Model + func (m *Model) HasOne(vi interface{}, name string) *Model + func (m *Model) LoadColumn(colIdx int, colName string, b []byte) error + func (m *Model) NewRecord() interface{} + type Options struct + Database string + DialTimeout time.Duration + Host string + IdleCheckFrequency time.Duration + IdleTimeout time.Duration + Network string + Params map[string]interface{} + Password string + PoolSize int + PoolTimeout time.Duration + Port string + ReadTimeout time.Duration + SSL bool + User string + WriteTimeout time.Duration + type Q string + func FormatQ(src string, params ...interface{}) (Q, error) + func MustFormatQ(src string, params ...interface{}) Q + func Where(s ...Q) Q + func (q Q) AppendQuery(dst []byte) []byte + func (q Q) AppendRawQuery(dst []byte) []byte + type QueryAppender interface + AppendQuery func([]byte) []byte + type RawQueryAppender interface + AppendRawQuery func([]byte) []byte + type Result interface + Affected func() int + type Stmt struct + func (stmt *Stmt) Close() error + func (stmt *Stmt) Exec(args ...interface{}) (res Result, err error) + func (stmt *Stmt) ExecOne(args ...interface{}) (Result, error) + func (stmt *Stmt) Query(coll interface{}, args ...interface{}) (res Result, err error) + func (stmt *Stmt) QueryOne(record interface{}, args ...interface{}) (Result, error) + type Strings []string + func (strings *Strings) LoadColumn(colIdx int, _ string, b []byte) error + func (strings *Strings) NewRecord() interface{} + func (strings Strings) AppendQuery(dst []byte) []byte + type Tx struct + func (tx *Tx) Commit() (err error) + func (tx *Tx) CopyFrom(r io.Reader, q string, args ...interface{}) (Result, error) + func (tx *Tx) Exec(q string, args ...interface{}) (Result, error) + func (tx *Tx) ExecOne(q string, args ...interface{}) (Result, error) + func (tx *Tx) Prepare(q string) (*Stmt, error) + func (tx *Tx) Query(coll interface{}, q string, args ...interface{}) (Result, error) + func (tx *Tx) QueryOne(record interface{}, q string, args ...interface{}) (Result, error) + func (tx *Tx) Rollback() (err error)