pgx

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Aug 31, 2024 License: BSD-3-Clause Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Connection

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

func Connect

func Connect(ctx context.Context, dsn string) (*Connection, error)

func NewConnection

func NewConnection(conn *pgx.Conn) *Connection

func (*Connection) BeginTx

func (conn *Connection) BeginTx(ctx context.Context, opts *dbal.TxOptions) (dbal.Tx, error)

func (*Connection) ExecuteCommand

func (conn *Connection) ExecuteCommand(ctx context.Context, sql string, args ...any) error

func (*Connection) ExecuteQuery

func (conn *Connection) ExecuteQuery(ctx context.Context, sql string, args ...any) (dbal.Rows, error)

type Pool

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

func ConnectPool

func ConnectPool(ctx context.Context, dsn string) (*Pool, error)

func NewPool

func NewPool(pool *pgxpool.Pool) *Pool

func (*Pool) BeginTx

func (pool *Pool) BeginTx(ctx context.Context, opts *dbal.TxOptions) (dbal.Tx, error)

func (*Pool) Close

func (pool *Pool) Close() error

func (*Pool) ExecuteCommand

func (pool *Pool) ExecuteCommand(ctx context.Context, sql string, args ...any) error

func (*Pool) ExecuteQuery

func (pool *Pool) ExecuteQuery(ctx context.Context, sql string, args ...any) (dbal.Rows, error)

type Rows

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

func NewRows

func NewRows(rows pgx.Rows) *Rows

func (*Rows) Close

func (rows *Rows) Close() error

func (*Rows) Next

func (rows *Rows) Next() bool

func (*Rows) Scan

func (rows *Rows) Scan(dest ...interface{}) error

type Tx

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

func NewTx

func NewTx(tx pgx.Tx) *Tx

func (*Tx) Commit

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

func (*Tx) ExecuteCommand

func (tx *Tx) ExecuteCommand(ctx context.Context, sql string, args ...interface{}) error

func (*Tx) ExecuteQuery

func (tx *Tx) ExecuteQuery(ctx context.Context, sql string, args ...interface{}) (dbal.Rows, error)

func (*Tx) Rollback

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

Jump to

Keyboard shortcuts

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