pgx

package module
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2023 License: MIT Imports: 4 Imported by: 1

README

pgx

PGX (github.com/jackc/pgx/v5) that implements github.com/gopsql/db.

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, readOnly bool) (db.Tx, error)

func (*DB) Close

func (d *DB) Close() error

func (*DB) DriverName added in v1.2.1

func (d *DB) DriverName() string

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) ExecContext added in v1.2.0

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

func (*DB) Query

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

func (*DB) QueryContext added in v1.2.0

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

func (*DB) QueryRow

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

func (*DB) QueryRowContext added in v1.2.0

func (d *DB) QueryRowContext(ctx context.Context, 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

func (*Rows) Columns added in v1.1.0

func (r *Rows) Columns() ([]string, 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