Documentation ¶
Index ¶
- func AboveOpr(name string, val model.RawVal, resultStackPtr *ResultStack) string
- func BelowOpr(name string, val model.RawVal, resultStackPtr *ResultStack) string
- func EqualOpr(name string, val model.RawVal, resultStackPtr *ResultStack) string
- func InOpr(name string, val model.RawVal, resultStackPtr *ResultStack) string
- func IsKeyWord(str string) bool
- func LikeOpr(name string, val model.RawVal, resultStackPtr *ResultStack) string
- func NotEqualOpr(name string, val model.RawVal, resultStackPtr *ResultStack) string
- func NotInOpr(name string, val model.RawVal, resultStackPtr *ResultStack) string
- func SortOpr(name string, ascSort bool) string
- type Builder
- func (s *Builder) BuildCount(vModel model.Model, filter model.Filter) (ret *ResultStack, err *cd.Result)
- func (s *Builder) BuildCreateRelationTable(vModel model.Model, vField model.Field, rModel model.Model) (ret *ResultStack, err *cd.Result)
- func (s *Builder) BuildCreateTable(vModel model.Model) (ret *ResultStack, err *cd.Result)
- func (s *Builder) BuildDelete(vModel model.Model) (ret *ResultStack, err *cd.Result)
- func (s *Builder) BuildDeleteRelation(vModel model.Model, vField model.Field, rModel model.Model) (delHost, delRelation *ResultStack, err *cd.Result)
- func (s *Builder) BuildDropRelationTable(vModel model.Model, vField model.Field, rModel model.Model) (ret *ResultStack, err *cd.Result)
- func (s *Builder) BuildDropTable(vModel model.Model) (ret *ResultStack, err *cd.Result)
- func (s *Builder) BuildInsert(vModel model.Model) (ret *ResultStack, err *cd.Result)
- func (s *Builder) BuildInsertRelation(vModel model.Model, vField model.Field, rModel model.Model) (ret *ResultStack, err *cd.Result)
- func (s *Builder) BuildQuery(vModel model.Model, filter model.Filter) (ret *ResultStack, err *cd.Result)
- func (s *Builder) BuildQueryPlaceHolder(vModel model.Model) (ret []any, err *cd.Result)
- func (s *Builder) BuildQueryRelation(vModel model.Model, vField model.Field, rModel model.Model) (ret *ResultStack, err *cd.Result)
- func (s *Builder) BuildQueryRelationPlaceHolder(vModel model.Model, vField model.Field, rModel model.Model) (ret any, err *cd.Result)
- func (s *Builder) BuildUpdate(vModel model.Model) (ret *ResultStack, err *cd.Result)
- func (s *Builder) GetFieldPlaceHolder(vField model.Field) (ret any, err *cd.Result)
- type Config
- type Executor
- func (s *Executor) BeginTransaction() (err *cd.Result)
- func (s *Executor) CheckTableExist(tableName string) (ret bool, err *cd.Result)
- func (s *Executor) CommitTransaction() (err *cd.Result)
- func (s *Executor) Connect() (err *cd.Result)
- func (s *Executor) Execute(sql string, args ...any) (rowsAffected int64, lastInsertID int64, err *cd.Result)
- func (s *Executor) Finish()
- func (s *Executor) GetField(value ...interface{}) (err *cd.Result)
- func (s *Executor) Next() bool
- func (s *Executor) Ping() (err *cd.Result)
- func (s *Executor) Query(sql string, needCols bool, args ...any) (ret []string, err *cd.Result)
- func (s *Executor) Release()
- func (s *Executor) RollbackTransaction() (err *cd.Result)
- type OprFunc
- type Pool
- func (s *Pool) CheckConfig(cfgPtr *Config) *cd.Result
- func (s *Pool) FetchOut() (ret *Executor, err *cd.Result)
- func (s *Pool) GetExecutor() (ret *Executor, err *cd.Result)
- func (s *Pool) Initialize(maxConnNum int, configPtr *Config) (err *cd.Result)
- func (s *Pool) PutIn(val *Executor)
- func (s *Pool) Uninitialized()
- type ResultStack
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AboveOpr ¶
func AboveOpr(name string, val model.RawVal, resultStackPtr *ResultStack) string
AboveOpr Above Opr
func BelowOpr ¶
func BelowOpr(name string, val model.RawVal, resultStackPtr *ResultStack) string
BelowOpr Below Opr
func EqualOpr ¶
func EqualOpr(name string, val model.RawVal, resultStackPtr *ResultStack) string
EqualOpr Equal Opr
func InOpr ¶
func InOpr(name string, val model.RawVal, resultStackPtr *ResultStack) string
InOpr In Opr
func LikeOpr ¶
func LikeOpr(name string, val model.RawVal, resultStackPtr *ResultStack) string
LikeOpr Like Opr
func NotEqualOpr ¶
func NotEqualOpr(name string, val model.RawVal, resultStackPtr *ResultStack) string
NotEqualOpr NotEqual Opr
Types ¶
type Builder ¶
type Builder struct {
// contains filtered or unexported fields
}
Builder Builder
func (*Builder) BuildCount ¶
func (s *Builder) BuildCount(vModel model.Model, filter model.Filter) (ret *ResultStack, err *cd.Result)
BuildCount build count
func (*Builder) BuildCreateRelationTable ¶ added in v1.3.28
func (s *Builder) BuildCreateRelationTable(vModel model.Model, vField model.Field, rModel model.Model) (ret *ResultStack, err *cd.Result)
BuildCreateRelationTable Build CreateRelation Schema
func (*Builder) BuildCreateTable ¶ added in v1.3.28
func (*Builder) BuildDelete ¶
BuildDelete BuildDelete
func (*Builder) BuildDeleteRelation ¶
func (s *Builder) BuildDeleteRelation(vModel model.Model, vField model.Field, rModel model.Model) (delHost, delRelation *ResultStack, err *cd.Result)
BuildDeleteRelation BuildDeleteRelation
func (*Builder) BuildDropRelationTable ¶ added in v1.3.28
func (s *Builder) BuildDropRelationTable(vModel model.Model, vField model.Field, rModel model.Model) (ret *ResultStack, err *cd.Result)
BuildDropRelationTable Build DropRelation Schema
func (*Builder) BuildDropTable ¶ added in v1.3.28
BuildDropTable BuildDropSchema
func (*Builder) BuildInsert ¶
BuildInsert Build Insert
func (*Builder) BuildInsertRelation ¶
func (s *Builder) BuildInsertRelation(vModel model.Model, vField model.Field, rModel model.Model) (ret *ResultStack, err *cd.Result)
BuildInsertRelation Build Insert Relation
func (*Builder) BuildQuery ¶
func (s *Builder) BuildQuery(vModel model.Model, filter model.Filter) (ret *ResultStack, err *cd.Result)
BuildQuery build query sql
func (*Builder) BuildQueryPlaceHolder ¶ added in v1.3.147
func (*Builder) BuildQueryRelation ¶
func (s *Builder) BuildQueryRelation(vModel model.Model, vField model.Field, rModel model.Model) (ret *ResultStack, err *cd.Result)
BuildQueryRelation build query relation sql
func (*Builder) BuildQueryRelationPlaceHolder ¶ added in v1.3.147
func (*Builder) BuildUpdate ¶
BuildUpdate Build Update
type Executor ¶
type Executor struct {
// contains filtered or unexported fields
}
Executor Executor
func NewExecutor ¶
NewExecutor 新建一个数据访问对象
func (*Executor) BeginTransaction ¶
func (*Executor) CheckTableExist ¶
CheckTableExist Check Table Exist
func (*Executor) CommitTransaction ¶
func (*Executor) RollbackTransaction ¶
type Pool ¶
type Pool struct {
// contains filtered or unexported fields
}
Pool executorPool
func (*Pool) Initialize ¶
Initialize initialize executor pool
func (*Pool) Uninitialized ¶ added in v1.3.0
func (s *Pool) Uninitialized()
Uninitialized uninitialized executor pool
type ResultStack ¶ added in v1.3.161
type ResultStack struct {
// contains filtered or unexported fields
}
func NewResult ¶ added in v1.3.147
func NewResult(sql string, args []any) *ResultStack
func (*ResultStack) Args ¶ added in v1.3.161
func (s *ResultStack) Args() []any
func (*ResultStack) PushArgs ¶ added in v1.3.161
func (s *ResultStack) PushArgs(arg ...any)
func (*ResultStack) SQL ¶ added in v1.3.161
func (s *ResultStack) SQL() string
func (*ResultStack) SetSQL ¶ added in v1.3.161
func (s *ResultStack) SetSQL(sql string)