db

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jan 12, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func OpenDB

func OpenDB(ds Datasource, opt ...Option) (*sql.DB, error)

Types

type Datasource

type Datasource interface {
	Driver() string
	DSN() string
}

func NewMySQLDatasource

func NewMySQLDatasource(username, password, host, dbname string) Datasource

type Option

type Option func(db *sql.DB)

func WithConnMaxLifetime

func WithConnMaxLifetime(d time.Duration) Option

func WithMaxIdleConns

func WithMaxIdleConns(num int) Option

func WithMaxOpenConns

func WithMaxOpenConns(num int) Option

Jump to

Keyboard shortcuts

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