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 ¶
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()
Click to show internal directories.
Click to hide internal directories.