database

package
v1.2.3 Latest Latest
Warning

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

Go to latest
Published: Aug 25, 2022 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DeferClose

func DeferClose(closer io.Closer)

DeferClose for io.Closer which swallows the error

func IsMySQLErrCode

func IsMySQLErrCode(err error, code uint16) bool

func IsMySQLErrTableNotExists

func IsMySQLErrTableNotExists(err error) bool

func OpenMySQLDB

func OpenMySQLDB(ds *MySQLDataSource) (*sql.DB, error)

func Scan

func Scan(rows *sql.Rows, dest map[string]interface{}, opt ScanOpt) error

Types

type MySQLDataSource

type MySQLDataSource struct {
	Addr     string
	Host     string
	Port     int
	Username string
	Password string
	Database string
	Timeout  time.Duration
	SSL      string
}

type ScanOpt

type ScanOpt struct {
	CaseInsensitive bool
}

Jump to

Keyboard shortcuts

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