database

package
v0.0.7 Latest Latest
Warning

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

Go to latest
Published: Mar 20, 2020 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MaxOpenConns    = 0
	MaxIdleConns    = 2
	ConnMaxLifetime = time.Duration(0) * time.Minute
)

Default values from the MySQL package.

Variables

View Source
var ErrNoRowsAffected = errors.New("no rows were affected")

ErrNoRowsAffected is dedicated for logging purposes. It is used if a query runs fine but for some reason nothing was changed in database.

Functions

func CalculateOffset

func CalculateOffset(page, limit int) int

CalculateOffset calculates `OFFSET` value for query.

func NewMySQL added in v0.0.7

func NewMySQL(address string, maxOpenConns, maxIdleConns int, connMaxLifetime time.Duration) (*sql.DB, error)

NewMySQL return `*sql.DB` instance.

Types

This section is empty.

Jump to

Keyboard shortcuts

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