pgx

package
v0.0.0-...-91dbb5c Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 12, 2021 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MustOpen

func MustOpen(conn string) db.DB

MustOpen is like Open but panics if connect operation fails.

func Open

func Open(conn string) (db.DB, error)

Open creates and establishes one connection to database.

Types

type DB

type DB struct {
	*pgxpool.Pool
}

func (*DB) BeginTx

func (d *DB) BeginTx(ctx context.Context, isolationLevel string) (db.Tx, error)

func (*DB) Close

func (d *DB) Close() error

func (*DB) ErrGetCode

func (d *DB) ErrGetCode(err error) string

func (*DB) ErrNoRows

func (d *DB) ErrNoRows() error

func (*DB) Exec

func (d *DB) Exec(query string, args ...interface{}) (db.Result, error)

func (*DB) Query

func (d *DB) Query(query string, args ...interface{}) (db.Rows, error)

func (*DB) QueryRow

func (d *DB) QueryRow(query string, args ...interface{}) db.Row

type Result

type Result struct {
	// contains filtered or unexported fields
}

func (Result) RowsAffected

func (r Result) RowsAffected() (int64, error)

type Rows

type Rows struct {
	pgx.Rows
}

func (*Rows) Close

func (r *Rows) Close() error

type Tx

type Tx struct {
	pgx.Tx
}

func (*Tx) Commit

func (t *Tx) Commit(ctx context.Context) error

func (*Tx) ExecContext

func (t *Tx) ExecContext(ctx context.Context, query string, args ...interface{}) (db.Result, error)

func (*Tx) QueryContext

func (t *Tx) QueryContext(ctx context.Context, query string, args ...interface{}) (db.Rows, error)

func (*Tx) QueryRowContext

func (t *Tx) QueryRowContext(ctx context.Context, query string, args ...interface{}) db.Row

func (*Tx) Rollback

func (t *Tx) Rollback(ctx context.Context) error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL