sql

package
v1.10.1 Latest Latest
Warning

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

Go to latest
Published: Aug 31, 2020 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetKeySQL

func GetKeySQL(key string, model interface{}, alias string) (sqlKey string, argsKey []interface{})

key search sql

func GetMoreKeySQL

func GetMoreKeySQL(key string, searModel interface{}, tables ...string) (sqlKey string, argsKey []interface{})

多张表, 第一个表为主表 key search sql tables [table1:table1_alias] searModel : 搜索字段模型

func GetReflectTags

func GetReflectTags(ref reflect.Type) (tags []string)

层级递增解析tag

func GetSQLError

func GetSQLError(error string) (err error)

数据库错误过滤、转换(友好提示)

func GetTags

func GetTags(model interface{}) []string

根据model中表模型的json标签获取表字段 将select* 变为对应的字段名

func GtTag

func GtTag(structTag reflect.StructTag, curTag string) (oTag, tag, tagTable string, b bool)

get tag

func StructWhereSQL added in v1.8.6

func StructWhereSQL(st interface{}) (sql string, args []interface{})

struct to where sql return key1 = value1 and key2 = value2...

func Table added in v1.8.9

func Table(table string) string

table parse

Types

This section is empty.

Jump to

Keyboard shortcuts

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