db

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Jun 19, 2023 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExeSqlByTransaction

func ExeSqlByTransaction(engine xorm.Engine, isCheck bool, sqlSlice ...*SqlData) error

通过事务提交sql isCheck,更新有效记录是否必须不为0

func GetTableName

func GetTableName(tableStruct interface{}) string

通过反射调用结构对应的TableName函数,达到返回表名的目的

func GetTableRowById

func GetTableRowById(engine *xorm.Engine, o interface{}, id int) error

func InitMap

func InitMap()

加载静态数据到缓存

func UpdateTableById

func UpdateTableById(engine *xorm.Engine, tableStruct interface{}, updateMap map[string]interface{}) error

根据主键 id通用更新表数据 tableStruct:为表映射后的结构指针 updateMap:为更新表数据的 map 结构,期中必须包含主键 id

Types

type SqlData

type SqlData struct {
	Sql   string
	Param []interface{}
}

Jump to

Keyboard shortcuts

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