db

package
v0.0.7 Latest Latest
Warning

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

Go to latest
Published: Jan 1, 2021 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 Pool

type Pool struct {
	*sqlx.DB
}

Pool of connections for interaction with Database

func New

func New(
	dsn string,
	logger *log.Logger,
	connMaxIdle time.Duration,
	connMaxLife time.Duration,
	connMaxOpenIdle int,
	connMaxOpen int,
) (*Pool, error)

New creates Pool of tcp connections to database

DSN for TCP conn is specified as: fmt.Sprintf("host=%s user=%s password=%s port=%s database=%s", dbTcpHost, dbUser, dbPwd, dbPort, dbName)

DSN for Unix socket is specified as: fmt.Sprintf("user=%s password=%s database=%s host=%s/%s", dbUser, dbPwd, dbName, socketDir, instanceConnectionName)

Jump to

Keyboard shortcuts

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