postgres

package
v0.0.4 Latest Latest
Warning

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

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

Documentation

Overview

Package postgres implements postgres connection.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Option

type Option func(*Postgres)

Option -.

func ConnAttempts

func ConnAttempts(attempts int) Option

ConnAttempts -.

func ConnTimeout

func ConnTimeout(timeout time.Duration) Option

ConnTimeout -.

func MaxPoolSize

func MaxPoolSize(size int) Option

MaxPoolSize -.

type Postgres

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

Postgres -.

func Mock

func Mock(Pool PostgresPool) *Postgres

Mock -.

func New

func New(url string, opts ...Option) (*Postgres, error)

New -.

func (*Postgres) Close

func (p *Postgres) Close()

Close -.

type PostgresPool

type PostgresPool interface {
	Exec(ctx context.Context, sql string, arguments ...any) (commandTag pgconn.CommandTag, err error)
	Query(ctx context.Context, sql string, args ...any) (pgx.Rows, error)
	QueryRow(ctx context.Context, sql string, args ...any) pgx.Row
	Close()
}

Jump to

Keyboard shortcuts

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