database

package
v0.0.0-...-26d71a5 Latest Latest
Warning

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

Go to latest
Published: Sep 28, 2024 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 Database

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

Postgres -.

type Option

type Option func(*Postgres)

Option -.

func ConnAttempts

func ConnAttempts(attempts int32) Option

ConnAttempts -.

func ConnTimeout

func ConnTimeout(timeout time.Duration) Option

ConnTimeout -.

func Isolation

func Isolation(isolation pgx.TxIsoLevel) Option

Isolation Level -.

func MaxPoolSize

func MaxPoolSize(size int32) Option

MaxPoolSize -.

type Postgres

type Postgres struct {
	Builder squirrel.StatementBuilderType
	Pool    *pgxpool.Pool
	// contains filtered or unexported fields
}

Postgres -.

func New

func New(cfg *config.Config, opts ...Option) (*Postgres, error)

New -.

func (*Postgres) Close

func (p *Postgres) Close()

Jump to

Keyboard shortcuts

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