Documentation
¶
Index ¶
- func FindSql(sqlId string) *parsing.DynamicData
- func ParseObject(bean interface{}) (reflection.Object, error)
- func RegisterMapperData(data []byte) error
- func RegisterMapperFile(file string) error
- func RegisterModel(model interface{})
- func RegisterModelWithName(name string, model interface{}) error
- func RegisterSql(sqlId string, sql string) error
- func UnregisterSql(sqlId string)
- type BaseRunner
- type DeleteRunner
- type InsertRunner
- type ModelName
- type ObjectCache
- type Runner
- type SelectRunner
- type Session
- func (this *Session) Delete(sql string) Runner
- func (this *Session) GetContext() context.Context
- func (this *Session) Insert(sql string) Runner
- func (this *Session) Select(sql string) Runner
- func (this *Session) SetContext(ctx context.Context) *Session
- func (this *Session) Tx(txFunc func(session *Session) bool)
- func (this *Session) Update(sql string) Runner
- type SessionManager
- type SqlManager
- type UpdateRunner
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FindSql ¶
func FindSql(sqlId string) *parsing.DynamicData
func ParseObject ¶
func ParseObject(bean interface{}) (reflection.Object, error)
func RegisterModel ¶
func RegisterModel(model interface{})
注册struct模型,模型描述了column和field之间的关联关系; 目前已非必要条件
Types ¶
type BaseRunner ¶
type BaseRunner struct {
// contains filtered or unexported fields
}
func (*BaseRunner) Context ¶
func (this *BaseRunner) Context(ctx context.Context) Runner
Context 设置执行的context
func (*BaseRunner) LastInsertId ¶
func (this *BaseRunner) LastInsertId() int64
func (*BaseRunner) Param ¶
func (this *BaseRunner) Param(params ...interface{}) Runner
func (*BaseRunner) Result ¶
func (this *BaseRunner) Result(bean interface{}) error
type DeleteRunner ¶
type DeleteRunner struct {
BaseRunner
}
func (*DeleteRunner) Result ¶
func (this *DeleteRunner) Result(bean interface{}) error
type InsertRunner ¶
type InsertRunner struct { BaseRunner // contains filtered or unexported fields }
func (*InsertRunner) LastInsertId ¶
func (this *InsertRunner) LastInsertId() int64
func (*InsertRunner) Result ¶
func (this *InsertRunner) Result(bean interface{}) error
type ObjectCache ¶
type ObjectCache struct {
// contains filtered or unexported fields
}
type Runner ¶
type SelectRunner ¶
type SelectRunner struct { BaseRunner // contains filtered or unexported fields }
func (*SelectRunner) Result ¶
func (this *SelectRunner) Result(bean interface{}) error
type Session ¶
type Session struct {
// contains filtered or unexported fields
}
func (*Session) Tx ¶
开启事务执行语句 返回true则提交,返回false回滚 抛出异常错误触发回滚
type SessionManager ¶
type SessionManager struct {
// contains filtered or unexported fields
}
func NewSessionManager ¶
func NewSessionManager(factory factory.Factory) *SessionManager
func (*SessionManager) NewSession ¶
func (this *SessionManager) NewSession() *Session
使用一个session操作数据库
type SqlManager ¶
type SqlManager struct {
// contains filtered or unexported fields
}
type UpdateRunner ¶
type UpdateRunner struct {
BaseRunner
}
func (*UpdateRunner) Result ¶
func (this *UpdateRunner) Result(bean interface{}) error
Source Files
¶
- init.go
- objectmanager.go
- sqlmanager.go
- sqlrunner.go
Click to show internal directories.
Click to hide internal directories.