Documentation ¶
Index ¶
- Variables
- func ConnDb() *xorm.Engine
- func Del(conn string)
- func Exec(sql string, Args ...interface{}) int64
- func Exec2(XX *xorm.Engine, sql string, Args ...interface{}) int64
- func Exec3(XX *xorm.Engine, debug, uid, username, module, ip, sql string, ...) int64
- func First(sqlorArgs ...interface{}) map[string]string
- func First2(XX *xorm.Engine, sqlorArgs ...interface{}) map[string]string
- func First3(XX *xorm.Engine, debug, uid, username, module, ip string, ...) map[string]string
- func FirstOrNil(sqlorArgs ...interface{}) map[string]string
- func FirstOrNil2(XX *xorm.Engine, sqlorArgs ...interface{}) map[string]string
- func InitX()
- func Insert(sql string, tb string, Args ...interface{}) int64
- func Insert2(XX *xorm.Engine, sql string, tb string, Args ...interface{}) int64
- func Insert3(XX *xorm.Engine, debug, uid, username, module, ip, sql string, tb string, ...) int64
- func NewDb(constr string) *xorm.Engine
- func NewDbMssql(conn string, server, port, uid, pwd, dbname string) *xorm.Engine
- func NewDbMysql(conn string, server, port, uid, pwd, dbname string) *xorm.Engine
- func NewDbSqlite(conn string, dbname string) *xorm.Engine
- func Page(page int, pageSize int, sqlorArgs ...interface{}) ([]map[string]string, int, int)
- func Pager(page int, pageSize int, sqlorArgs ...interface{}) interface{}
- func ParseByte(drivername string, beans []map[string][]byte) []map[string]string
- func Query(sqlorArgs ...interface{}) []map[string]string
- func Query2(XX *xorm.Engine, sqlorArgs ...interface{}) []map[string]string
- func Query3(XX *xorm.Engine, debug, uid, username, module, ip string, ...) []map[string]string
- func RandomString(lenght int) string
- func Substring(str, starting, ending string) string
- func TimeoutWarning(tag, msg string, start time.Time, timeLimit float64)
- type PageData
Constants ¶
This section is empty.
Variables ¶
View Source
var X *xorm.Engine
X 数据引擎
View Source
var XLog *xorm.Engine
Functions ¶
func Exec3 ¶
func Exec3(XX *xorm.Engine, debug, uid, username, module, ip, sql string, Args ...interface{}) int64
Exec 执行SQL语句 --指定数据库链接
func First3 ¶
func First3(XX *xorm.Engine, debug, uid, username, module, ip string, sqlorArgs ...interface{}) map[string]string
First3 SQL语句查询第一条记录 --指定数据库链接
func FirstOrNil2 ¶
FirstOrNil2 第一条或空
func Insert3 ¶
func Insert3(XX *xorm.Engine, debug, uid, username, module, ip, sql string, tb string, Args ...interface{}) int64
Insert3 执行插入语句 --指定数据库链接
func NewDbMssql ¶
生成新的mssql数据库链接,conn连接标识
func NewDbMysql ¶
生成新的mysql数据库链接,conn连接标识
func NewDbSqlite ¶
生成新的sqlite数据库链接,conn连接标识,dbname数据库名称
func Query3 ¶
func Query3(XX *xorm.Engine, debug, uid, username, module, ip string, sqlorArgs ...interface{}) []map[string]string
Query3 SQL语句查询 --指定链接
func RandomString ¶
MD5加密方式
data := []byte("admin") has := md5.Sum(data) md5str1 := fmt.Sprintf("%x", has) //将[]byte转成16进制 fmt.Println("md5:",md5str1)
随机字符串
Types ¶
type PageData ¶
type PageData struct { Total int `json:"total"` Pages int `json:"pages"` Rows []map[string]string `json:"rows"` Extra string `json:"extra"` }
Click to show internal directories.
Click to hide internal directories.