GoMybatis

package module
v7.0.3 Latest Latest
Warning

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

Go to latest
Published: Jun 4, 2022 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const Adapter_FormateDate = `2006-01-02 15:04:05`
View Source
const Element_Mapper = "mapper"
View Source
const ID = `id`

Variables

View Source
var (
	IntType   = reflect.TypeOf(c_INT_DEFAULT)
	Int8Type  = reflect.TypeOf(c_INT8_DEFAULT)
	Int16Type = reflect.TypeOf(c_INT16_DEFAULT)
	Int32Type = reflect.TypeOf(c_INT32_DEFAULT)
	Int64Type = reflect.TypeOf(c_INT64_DEFAULT)

	UintType   = reflect.TypeOf(c_UINT_DEFAULT)
	Uint8Type  = reflect.TypeOf(c_UINT8_DEFAULT)
	Uint16Type = reflect.TypeOf(c_UINT16_DEFAULT)
	Uint32Type = reflect.TypeOf(c_UINT32_DEFAULT)
	Uint64Type = reflect.TypeOf(c_UINT64_DEFAULT)

	Float32Type = reflect.TypeOf(c_FLOAT32_DEFAULT)
	Float64Type = reflect.TypeOf(c_FLOAT64_DEFAULT)

	Complex64Type  = reflect.TypeOf(c_COMPLEX64_DEFAULT)
	Complex128Type = reflect.TypeOf(c_COMPLEX128_DEFAULT)

	StringType = reflect.TypeOf(c_EMPTY_STRING)
	BoolType   = reflect.TypeOf(c_BOOL_DEFAULT)
	ByteType   = reflect.TypeOf(c_BYTE_DEFAULT)
	BytesType  = reflect.SliceOf(ByteType)

	TimeType = reflect.TypeOf(c_TIME_DEFAULT)
)
View Source
var (
	PtrIntType   = reflect.PtrTo(IntType)
	PtrInt8Type  = reflect.PtrTo(Int8Type)
	PtrInt16Type = reflect.PtrTo(Int16Type)
	PtrInt32Type = reflect.PtrTo(Int32Type)
	PtrInt64Type = reflect.PtrTo(Int64Type)

	PtrUintType   = reflect.PtrTo(UintType)
	PtrUint8Type  = reflect.PtrTo(Uint8Type)
	PtrUint16Type = reflect.PtrTo(Uint16Type)
	PtrUint32Type = reflect.PtrTo(Uint32Type)
	PtrUint64Type = reflect.PtrTo(Uint64Type)

	PtrFloat32Type = reflect.PtrTo(Float32Type)
	PtrFloat64Type = reflect.PtrTo(Float64Type)

	PtrComplex64Type  = reflect.PtrTo(Complex64Type)
	PtrComplex128Type = reflect.PtrTo(Complex128Type)

	PtrStringType = reflect.PtrTo(StringType)
	PtrBoolType   = reflect.PtrTo(BoolType)
	PtrByteType   = reflect.PtrTo(ByteType)

	PtrTimeType = reflect.PtrTo(TimeType)
)

Functions

func LoadMapperXml

func LoadMapperXml(bytes []byte) (items map[string]etree.Token)

Types

type ElementType

type ElementType = string
const (
	//root elements
	Element_ResultMap ElementType = "resultMap"
	Element_Insert    ElementType = "insert"
	Element_Delete    ElementType = "delete"
	Element_Update    ElementType = `update`
	Element_Select    ElementType = "select"
	Element_Sql       ElementType = "sql"

	//root template elements
	Element_Insert_Template ElementType = "insertTemplate"
	Element_Delete_Template ElementType = "deleteTemplate"
	Element_Update_Template ElementType = `updateTemplate`
	Element_Select_Template ElementType = "selectTemplate"

	//child elements
	Element_bind      ElementType = "bind"
	Element_String    ElementType = "string"
	Element_If        ElementType = `if`
	Element_Trim      ElementType = "trim"
	Element_Foreach   ElementType = "foreach"
	Element_Set       ElementType = "set"
	Element_choose    ElementType = "choose"
	Element_when      ElementType = "when"
	Element_otherwise ElementType = "otherwise"
	Element_where     ElementType = "where"
	Element_Include   ElementType = "include"
)

type ExpressionEngineLexerCache

type ExpressionEngineLexerCache interface {
	Set(expression string, lexer interface{}) error
	Get(expression string) (interface{}, error)
	Name() string
}

Lexer 结果缓存

type ExpressionEngineLexerCacheable

type ExpressionEngineLexerCacheable interface {
	SetUseLexerCache(use bool) error
	LexerCacheable() bool
}

type ExpressionEngineLexerMapCache

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

func (*ExpressionEngineLexerMapCache) Get

func (it *ExpressionEngineLexerMapCache) Get(expression string) (interface{}, error)

func (*ExpressionEngineLexerMapCache) Name

func (ExpressionEngineLexerMapCache) New

func (*ExpressionEngineLexerMapCache) Set

func (it *ExpressionEngineLexerMapCache) Set(expression string, lexer interface{}) error

type ExpressionEngineProxy

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

func (*ExpressionEngineProxy) Eval

func (it *ExpressionEngineProxy) Eval(lexerResult interface{}, arg interface{}, operation int) (interface{}, error)

执行一个表达式 参数:lexerResult=编译结果,arg=参数 返回:执行结果,错误

func (*ExpressionEngineProxy) Lexer

func (it *ExpressionEngineProxy) Lexer(expression string) (interface{}, error)

编译一个表达式 参数:lexerArg 表达式内容 返回:interface{} 编译结果,error 错误

func (*ExpressionEngineProxy) LexerAndEval

func (it *ExpressionEngineProxy) LexerAndEval(expression string, arg interface{}) (interface{}, error)

执行

func (*ExpressionEngineProxy) LexerCache

func (*ExpressionEngineProxy) LexerCacheable

func (it *ExpressionEngineProxy) LexerCacheable() bool

func (ExpressionEngineProxy) Name

func (it ExpressionEngineProxy) Name() string

引擎名称

func (ExpressionEngineProxy) New

engine :表达式引擎,useLexerCache:是否缓存Lexer表达式编译结果

func (*ExpressionEngineProxy) SetExpressionEngine

func (it *ExpressionEngineProxy) SetExpressionEngine(engine ast.ExpressionEngine)

引擎名称

func (*ExpressionEngineProxy) SetLexerCache

func (it *ExpressionEngineProxy) SetLexerCache(cache ExpressionEngineLexerCache)

func (*ExpressionEngineProxy) SetUseLexerCache

func (it *ExpressionEngineProxy) SetUseLexerCache(isUseCache bool) error

type GoMybatisSqlArgTypeConvert

type GoMybatisSqlArgTypeConvert struct {
}

Sql内容类型转换器

func (GoMybatisSqlArgTypeConvert) Convert

func (it GoMybatisSqlArgTypeConvert) Convert(argValue interface{}) string

Sql内容类型转换器

type GoMybatisSqlBuilder

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

func (*GoMybatisSqlBuilder) BuildSql

func (it *GoMybatisSqlBuilder) BuildSql(paramMap map[string]interface{}, nodes []ast.Node, arg_array *[]interface{}) (string, error)

func (*GoMybatisSqlBuilder) EnableLog

func (it *GoMybatisSqlBuilder) EnableLog() bool

func (*GoMybatisSqlBuilder) ExpressionEngineProxy

func (it *GoMybatisSqlBuilder) ExpressionEngineProxy() *ExpressionEngineProxy

func (GoMybatisSqlBuilder) New

func (it GoMybatisSqlBuilder) New(expressionEngine ExpressionEngineProxy, log Log, enableLog bool) GoMybatisSqlBuilder

func (*GoMybatisSqlBuilder) NodeParser

func (it *GoMybatisSqlBuilder) NodeParser() ast.NodeParser

func (*GoMybatisSqlBuilder) SetEnableLog

func (it *GoMybatisSqlBuilder) SetEnableLog(enable bool)

type Log

type Log interface {
	Println(messages ...string) //日志输出方法实现
}

type LogStandard

type LogStandard struct {
	PrintlnFunc func(messages ...string) //日志输出方法实现
}

func (*LogStandard) Println

func (it *LogStandard) Println(v ...string)

日志输出方法实现

Directories

Path Synopsis
lib

Jump to

Keyboard shortcuts

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