xsql

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Oct 8, 2019 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	FIELD_RULE_ADMIN_DETAIL = "MD"
	FIELD_RULE_ADMIN_LIST   = "ML"
	FIELD_RULE_USER_DETAIL  = "UD"
	FIELD_RULE_USER_LIST    = "UL"
	FIELD_RULE_GUEST_DETAIL = "GD"
	FIELD_RULE_GUEST_LIST   = "GL"
)

Variables

This section is empty.

Functions

func BuildSqlAllField

func BuildSqlAllField(fields map[string]interface{}) string

生成所有字段列表

func BuildSqlAllFieldArray

func BuildSqlAllFieldArray(fields map[string]interface{}) []string

生成所有字段列表数组

func BuildSqlField

func BuildSqlField(fields map[string]interface{}, rule string, tableAlias ...string) string

func BuildSqlFieldBySelect

func BuildSqlFieldBySelect(fields map[string]interface{}, selects interface{}, tableAlias ...string) string

使用selects选择器生成sql查询字段列表 selects 可用值:nil, 字段列表字符串,[]string

func CheckFieldNameValid

func CheckFieldNameValid(fields map[string]interface{}, fieldName string) bool

检查字段名是否有效

func CreateDateBetweenFilterSql

func CreateDateBetweenFilterSql(fieldName string, startDate string, endDate string) string

生成sql时间段条件表达式

func FilterSortFields

func FilterSortFields(sort string, options map[string]interface{}, selects ...map[string]bool) string

过滤排序字段字符串

func ParseSortFields

func ParseSortFields(str string, options map[string]interface{}, selects ...map[string]bool) []string

解析过滤排序字段 options.alias :表别名

func QueryFields

func QueryFields(tableAlias string, fields ...string) string

生成查询字段列表

Types

type FieldRule

type FieldRule string

根据规规则,生成sql查询字段列表

type QueryField

type QueryField struct {
	// contains filtered or unexported fields
}

func (*QueryField) Parse

func (f *QueryField) Parse(field string)

func (*QueryField) String

func (f *QueryField) String() string

Jump to

Keyboard shortcuts

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