sqlbuilder

package
v0.0.6 Latest Latest
Warning

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

Go to latest
Published: Sep 18, 2019 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const Adapter_FormateDate = `2006-01-02 15:04:05`

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 Row2map

func Row2map(rows *sql.Rows, fields []string) (resultsMap map[string][]byte, err error)

func Rows2maps

func Rows2maps(rows *sql.Rows) (resultsSlice []map[string][]byte, err error)

Types

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 (*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 GoMybatisSqlResultDecoder

type GoMybatisSqlResultDecoder struct {
}

func (GoMybatisSqlResultDecoder) Decode

func (it GoMybatisSqlResultDecoder) Decode(resultMap map[string]*ResultProperty, sqlResult []map[string][]byte, result interface{}) error

type ResultProperty

type ResultProperty struct {
	XMLName  string //`xml:"result/id"`
	Column   string
	Property string
	GoType   string
}

type SqlBuilder

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

func New

func New(engine ast.ExpressionEngine, logEnable bool, logger logger.Log) SqlBuilder

func (*SqlBuilder) BuildSql

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

func (*SqlBuilder) EnableLog

func (it *SqlBuilder) EnableLog() bool

func (*SqlBuilder) ExpressionEngineProxy

func (it *SqlBuilder) ExpressionEngineProxy() *ExpressionEngineProxy

func (SqlBuilder) New

func (it SqlBuilder) New(SqlArgTypeConvert ast.SqlArgTypeConvert, expressionEngine ExpressionEngineProxy, log logger.Log, enableLog bool) SqlBuilder

func (*SqlBuilder) NodeParser

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

func (*SqlBuilder) SetEnableLog

func (it *SqlBuilder) SetEnableLog(enable bool)

func (*SqlBuilder) SqlArgTypeConvert

func (it *SqlBuilder) SqlArgTypeConvert() ast.SqlArgTypeConvert

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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