postgres

package
v0.0.0-...-7555876 Latest Latest
Warning

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

Go to latest
Published: Feb 18, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DBConn

type DBConn interface {
	Exec(ctx context.Context, sql string, arguments ...any) (pgconn.CommandTag, error)
	Query(ctx context.Context, sql string, optionsAndArgs ...interface{}) (pgx.Rows, error)
	QueryRow(ctx context.Context, sql string, optionsAndArgs ...interface{}) pgx.Row
}

DBConn implemented by pgx.Conn and pgx.Tx.

type DBConnection

type DBConnection struct {
	Conn DBConn
	// contains filtered or unexported fields
}

func Connect

func Connect(ctx context.Context, config config.Database) (*DBConnection, error)

func (*DBConnection) Close

func (d *DBConnection) Close() error

func (*DBConnection) WithTransaction

func (d *DBConnection) WithTransaction(ctx context.Context, f func(conn *DBConnection) error) error

Jump to

Keyboard shortcuts

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