db

package
v0.0.0-...-bb3bbde Latest Latest
Warning

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

Go to latest
Published: Jun 9, 2017 License: MIT Imports: 7 Imported by: 1

Documentation

Index

Constants

View Source
const (
	DRIVER_MYSQL = "mysql"
)
View Source
const (
	FORMART_CON_STR_MYSQL = "%[1]s:%[2]s@(%[3]s)/%[4]s"
)
View Source
const SQL_TAG = "sql"

Variables

This section is empty.

Functions

func SqlScanStruct

func SqlScanStruct(rows *sql.Rows, outputStruct interface{}) error

Remember call rows.Next() before call SqlScanStruct(), finally should be rows.Close()

Types

type SqlDBFactory

type SqlDBFactory struct {
	Driver   string // Supported driver: "mysql"
	Server   string // host[:port]
	User     string // login name
	Pwd      string // password
	Database string // database / schema

	IsEnable bool
}

func (*SqlDBFactory) Check

func (this *SqlDBFactory) Check() error

func (*SqlDBFactory) NewConnect

func (this *SqlDBFactory) NewConnect() *sql.DB

If no error, return *sql.DB, do not forget to defer db.Close()

Jump to

Keyboard shortcuts

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