mysql

package
v0.0.0-...-0c08822 Latest Latest
Warning

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

Go to latest
Published: Jan 31, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(c *Configuration) *sqlx.DB

func NewFromEnv

func NewFromEnv() *sqlx.DB

func Tx

func Tx(ctx context.Context, db *sqlx.DB, wrapper func(tx *sqlx.Tx) error) error

Types

type Configuration

type Configuration struct {
	Addr            string        `yaml:"addr"`
	User            string        `yaml:"user"`
	Password        string        `yaml:"password"`
	Database        string        `yaml:"database"`
	MaxOpenConns    int           `yaml:"max_open_conns"`
	MaxIdleConns    int           `yaml:"max_idle_conns"`
	ConnMaxLifeTime time.Duration `yaml:"conn_max_life_time"`
	ConnMaxIdleTime time.Duration `yaml:"conn_max_idle_time"`
}

func (*Configuration) Init

func (c *Configuration) Init() error

Jump to

Keyboard shortcuts

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