gorm

package
v0.0.0-...-0090c64 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2024 License: GPL-3.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	GormDB *gorm.DB //数据库操作对象

)

Functions

This section is empty.

Types

type GormUtil

type GormUtil struct{}

type SqlFactory

type SqlFactory struct{}

func (SqlFactory) Exec

func (sf SqlFactory) Exec(sql string, params ...interface{}) (tx *gorm.DB)

调用数据更新

func (SqlFactory) GetDB

func (sf SqlFactory) GetDB() *gorm.DB

取gorm操作对象

func (SqlFactory) GetDbName

func (sf SqlFactory) GetDbName(name string) string

取数据库名称

func (SqlFactory) GetVariable

func (sf SqlFactory) GetVariable(name string) string

取数据库全局变量

func (SqlFactory) Raw

func (sf SqlFactory) Raw(sql string, params ...interface{}) (tx *gorm.DB)

调用数据查询

func (SqlFactory) ReplaceVariable

func (sf SqlFactory) ReplaceVariable(sqlstr string) string

替换字符串中的所有全局变量

func (SqlFactory) ScanRows2map

func (sf SqlFactory) ScanRows2map(rows *sql.Rows) []map[string]string

将查询结果转换成map数组,常用于原生sql查询

func (SqlFactory) ScanRows2mapI

func (sf SqlFactory) ScanRows2mapI(rows *sql.Rows) []map[string]interface{}

将查询结果转换成map数组,常用于原生sql查询

Jump to

Keyboard shortcuts

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