Help us shape the future of Go! Take the 2026 Go Developer Survey

postgres

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jun 7, 2025 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

func NewClient

func NewClient(dsn string, opts ...Option) (*Client, error)

func (*Client) Close

func (c *Client) Close() error

func (*Client) DB

func (c *Client) DB() *sql.DB

func (*Client) Exec

func (c *Client) Exec(ctx context.Context, query string, args ...any) (pgconn.CommandTag, error)

func (*Client) Master

func (c *Client) Master() *pgxpool.Pool

func (*Client) Ping

func (c *Client) Ping(ctx context.Context) error

func (*Client) Query

func (c *Client) Query(ctx context.Context, query string, args ...any) (pgx.Rows, error)

func (*Client) QueryRow

func (c *Client) QueryRow(ctx context.Context, query string, args ...any) pgx.Row

func (*Client) ScanQuery

func (c *Client) ScanQuery(ctx context.Context, dst any, query string, args ...any) error

func (*Client) ScanQueryRow

func (c *Client) ScanQueryRow(ctx context.Context, dst any, query string, args ...any) error

type Option

type Option func(c *Client) error

func WithLogger

func WithLogger(logger *slog.Logger) Option

type Transaction

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

func NewTransaction

func NewTransaction(db *pgxpool.Pool) *Transaction

func (*Transaction) ReadCommitted

func (t *Transaction) ReadCommitted(ctx context.Context, fn func(ctx context.Context) error) error

Jump to

Keyboard shortcuts

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