postgres

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Nov 14, 2025 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type OpenConnectionOption

type OpenConnectionOption func(*sqlx.DB) error

func WithConnectionMaxLifeTime

func WithConnectionMaxLifeTime(d time.Duration) OpenConnectionOption

func WithMaxIdleConnections

func WithMaxIdleConnections(n int) OpenConnectionOption

func WithMaxOpenConnections

func WithMaxOpenConnections(n int) OpenConnectionOption

func WithSetConnMaxIdleTime

func WithSetConnMaxIdleTime(d time.Duration) OpenConnectionOption

type SQLXDB

type SQLXDB struct {
	*sqlx.DB
}

SQLXDB is a wrapper around sqlx.DB

func Open

func Open(dsn string, maxRetries int, options ...OpenConnectionOption) (*SQLXDB, error)

Open opens a new database connection with the given dsn It applies options after opening the connection

Jump to

Keyboard shortcuts

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