db

package
v0.0.0-...-377a973 Latest Latest
Warning

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

Go to latest
Published: Jul 30, 2020 License: BSD-3-Clause Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PING_TIME = 600 //数据库ping的时间间隔(秒)
)

Variables

View Source
var (

	//stmt *sql.Stmt
	//rows *sql.Rows
	DbConfig = conf.DbConfig{} //[配置文件config.conf]保存数据库配置信息
)

Functions

func CloseConn

func CloseConn()

func ConnectDB

func ConnectDB() (db *sql.DB, err error)

func DML

func DML(sql string, args ...interface{}) (n int64, lastInsertId int64, err error)

执行数据库增删改

func DQL

func DQL(sql string, args ...interface{}) (rows *sql.Rows, err error)

执行数据库查询

func GetDB

func GetDB() *sql.DB

Types

This section is empty.

Jump to

Keyboard shortcuts

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