Documentation ¶
Index ¶
- Variables
- func NewTxOptions(level sql.IsolationLevel, readonly bool) *sql.TxOptions
- type Config
- type DbOp
- func (c *DbOp) BeginTx(ctx context.Context, opt *sql.TxOptions) (*TxOp, error)
- func (c *DbOp) BeginTxWithDb(ctx context.Context, i interface{}, opt *sql.TxOptions) (*TxOp, error)
- func (c *DbOp) Exec(id string, data interface{}) (int64, error)
- func (c *DbOp) ExecContext(ctx context.Context, id string, data interface{}) (int64, error)
- func (c *DbOp) ExecRtn(id string, data interface{}, mrh MultiRowsHandler) error
- func (c *DbOp) ExecRtnContext(ctx context.Context, id string, data interface{}, mrh MultiRowsHandler) error
- func (c *DbOp) Query(id string, data interface{}, mrh MultiRowsHandler) error
- func (c *DbOp) QueryContext(ctx context.Context, id string, data interface{}, mrh MultiRowsHandler) error
- type Manifest
- type MultiRowsHandler
- type NestableSqlAssmbler
- type RowScanner
- type SqlAssembler
- type SqlAssemblerSet
- type SqlDescriber
- type SqlRender
- type StdSqlAssembler
- type StdSqlDescriber
- type StdTemplateRender
- type TxOp
- func (c *TxOp) Commit() error
- func (c *TxOp) Exec(id string, data interface{}) (int64, error)
- func (c *TxOp) ExecContext(ctx context.Context, id string, data interface{}) (int64, error)
- func (c *TxOp) ExecRtn(id string, data interface{}, mrh MultiRowsHandler) error
- func (c *TxOp) ExecRtnContext(ctx context.Context, id string, data interface{}, mrh MultiRowsHandler) error
- func (c *TxOp) Query(id string, data interface{}, mrh MultiRowsHandler) error
- func (c *TxOp) QueryContext(ctx context.Context, id string, data interface{}, mrh MultiRowsHandler) error
- func (c *TxOp) Rollback() error
Constants ¶
This section is empty.
Variables ¶
View Source
var Debug = false
View Source
var ( DefaultManifest = Manifest{ Default: Config{ TimeOut: 0, ReadOnly: false, Extra: make(map[string]interface{}), }, ConfigMap: make(map[string]Config), } )
View Source
var (
DefaultTxOptions *sql.TxOptions = NewTxOptions(sql.LevelDefault, false)
)
Functions ¶
func NewTxOptions ¶
func NewTxOptions(level sql.IsolationLevel, readonly bool) *sql.TxOptions
Types ¶
type DbOp ¶
type DbOp struct {
// contains filtered or unexported fields
}
func (*DbOp) BeginTxWithDb ¶
func (*DbOp) ExecContext ¶
func (*DbOp) ExecRtn ¶
func (c *DbOp) ExecRtn(id string, data interface{}, mrh MultiRowsHandler) error
func (*DbOp) ExecRtnContext ¶
func (*DbOp) QueryContext ¶
type Manifest ¶
func (Manifest) GetConfigCopy ¶
type MultiRowsHandler ¶
type MultiRowsHandler interface { HandleRow(r RowScanner) AddResultSet() }
type NestableSqlAssmbler ¶
type NestableSqlAssmbler interface { SqlAssembler HasId(id string) bool }
type RowScanner ¶
type SqlAssembler ¶
type SqlAssembler interface {
AssembleSql(id string, data interface{}) (SqlDescriber, error)
}
type SqlAssemblerSet ¶
type SqlAssemblerSet struct {
// contains filtered or unexported fields
}
func NewSqlAssemblerSet ¶
func NewSqlAssemblerSet(def SqlAssembler, assemblers ...NestableSqlAssmbler) *SqlAssemblerSet
func (*SqlAssemblerSet) AssembleSql ¶
func (n *SqlAssemblerSet) AssembleSql(id string, data interface{}) (SqlDescriber, error)
type SqlDescriber ¶
type StdSqlAssembler ¶
func NewStdSqlAssembler ¶
func NewStdSqlAssembler(r SqlRender, m Manifest) *StdSqlAssembler
func NewStdSqlAssemblerDefault ¶
func NewStdSqlAssemblerDefault(pattern string) *StdSqlAssembler
func (*StdSqlAssembler) AssembleSql ¶
func (l *StdSqlAssembler) AssembleSql(id string, data interface{}) (SqlDescriber, error)
type StdSqlDescriber ¶
type StdSqlDescriber struct { Id string Data interface{} Config Config bytes.Buffer // contains filtered or unexported fields }
func (*StdSqlDescriber) IsReadOnly ¶
func (s *StdSqlDescriber) IsReadOnly() bool
func (*StdSqlDescriber) Release ¶
func (s *StdSqlDescriber) Release()
func (*StdSqlDescriber) WithContext ¶
func (s *StdSqlDescriber) WithContext(c context.Context) context.Context
type StdTemplateRender ¶
type StdTemplateRender struct {
// contains filtered or unexported fields
}
func NewStdTemplateRender ¶
func NewStdTemplateRender(pattern string, funcMap template.FuncMap) *StdTemplateRender
func NewStdTemplateRenderDefault ¶
func NewStdTemplateRenderDefault(pattern string) *StdTemplateRender
type TxOp ¶
type TxOp struct {
// contains filtered or unexported fields
}
func (*TxOp) ExecContext ¶
func (*TxOp) ExecRtn ¶
func (c *TxOp) ExecRtn(id string, data interface{}, mrh MultiRowsHandler) error
func (*TxOp) ExecRtnContext ¶
func (*TxOp) QueryContext ¶
Click to show internal directories.
Click to hide internal directories.