Documentation ¶
Index ¶
- func CreateFactory(opts ...FacOpt) (factory.Factory, error)
- func FindSql(sqlId string) *parsing.DynamicData
- func NewFactory(opts ...FacOpt) factory.Factory
- 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 FacOpt
- 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) error)
- 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 NewFactory ¶ added in v0.0.5
func ParseObject ¶
func ParseObject(bean interface{}) (reflection.Object, error)
func RegisterMapperData ¶
func RegisterMapperFile ¶
func RegisterModel ¶
func RegisterModel(model interface{})
注册struct模型,模型描述了column和field之间的关联关系; 目前已非必要条件
func RegisterModelWithName ¶
func RegisterSql ¶
func UnregisterSql ¶
func UnregisterSql(sqlId string)
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 FacOpt ¶ added in v0.0.5
type FacOpt func(f *factory.DefaultFactory)
func SetConnMaxLifetime ¶ added in v0.0.5
func SetDataSource ¶ added in v0.0.5
func SetDataSource(v datasource.DataSource) FacOpt
func SetMaxConn ¶ added in v0.0.5
func SetMaxIdleConn ¶ added in v0.0.5
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 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) GetContext ¶
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 ¶
Click to show internal directories.
Click to hide internal directories.