sqlTemplate

package
v0.0.0-...-1bf96ee Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2022 License: AGPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Cache_sqlite = "sqlite"
	Cache_mysql  = "local"
)

Variables

This section is empty.

Functions

func Delete

func Delete(sql string, param map[string]interface{}, cacheSql bool) error

* 封装 删除数据

func Insert

func Insert(sql string, param map[string]interface{}, cacheSql bool) error

* 封装 新增数据

func ParseSql

func ParseSql(sql string, param map[string]interface{}) (string, []interface{})

* 解析sql 引擎

`select * count from host_group t
				where
				1=1
				$if name != '' then
				and t.name = #name#
				$endif
				$if name != '' then
				and t.name = #name#
				$endif

func SelectList

func SelectList(sql string, param map[string]interface{}, callback func(db *gorm.DB), cacheSql bool)

* 封装 查询列表

func SelectOne

func SelectOne(sql string, param map[string]interface{}, callback func(db *gorm.DB), cacheSql bool)

* 封装 查询单个

func Update

func Update(sql string, param map[string]interface{}, cacheSql bool) error

* 封装 修改数据

Types

This section is empty.

Jump to

Keyboard shortcuts

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