postgres

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Mar 28, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewDB

func NewDB(pool *pgxpool.Pool) db.Conn

Types

type CopyFromTx

type CopyFromTx interface {
	db.Tx
	CopyFrom(ctx context.Context, table pgx.Identifier, columns []string, source pgx.CopyFromSource) (int64, error)
}

type DB

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

func (*DB) Begin

func (p *DB) Begin(ctx context.Context) (db.Tx, error)

func (*DB) Exec

func (p *DB) Exec(ctx context.Context, sql string, args ...any) (db.Result, error)

func (*DB) Ping

func (p *DB) Ping(ctx context.Context) error

func (*DB) Query

func (p *DB) Query(ctx context.Context, sql string, args ...any) (db.Rows, error)

func (*DB) QueryRow

func (p *DB) QueryRow(ctx context.Context, sql string, args ...any) db.Row

type Row

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

func (*Row) Scan

func (r *Row) Scan(dest ...any) error

type Rows

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

func (*Rows) Close

func (r *Rows) Close() error

func (*Rows) Err

func (r *Rows) Err() error

func (*Rows) Next

func (r *Rows) Next() bool

func (*Rows) Scan

func (r *Rows) Scan(dest ...any) error

type Tx

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

func (*Tx) Commit

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

func (*Tx) CopyFrom

func (t *Tx) CopyFrom(
	ctx context.Context,
	tableName pgx.Identifier,
	columnNames []string,
	rowSrc pgx.CopyFromSource,
) (int64, error)

func (*Tx) Exec

func (t *Tx) Exec(ctx context.Context, sql string, args ...any) (db.Result, error)

func (*Tx) Query

func (t *Tx) Query(ctx context.Context, sql string, args ...any) (db.Rows, error)

func (*Tx) QueryRow

func (t *Tx) QueryRow(ctx context.Context, sql string, args ...any) 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