Documentation ¶
Index ¶
- Variables
- func Commit(t TxEnd) error
- func Exec(execer TExecer, ctx context.Context, id string, param interface{}) (r sql.Result, err error)
- func ExecRtn(execer TExecer, ctx context.Context, id string, param interface{}, ...) (err error)
- func MustConnect(dbname, dsname string) *sqlx.DB
- func MustExec(execer TExecer, ctx context.Context, id string, param interface{}) (r sql.Result)
- func MustExecRtn(execer TExecer, ctx context.Context, id string, param interface{}, ...)
- func MustQuery(execer TExecer, ctx context.Context, id string, param interface{}, ...)
- func MustSql(maker Maker, id string, param interface{}) (sql string)
- func NewTxOptions(level sql.IsolationLevel, readonly bool) *sql.TxOptions
- func Query(execer TExecer, ctx context.Context, id string, param interface{}, ...) (err error)
- func Rollback(t TxEnd) error
- func Sql(maker Maker, id string, param interface{}) (string, error)
- type Dbop
- func (c *Dbop) TBegin(ctx context.Context, opt *sql.TxOptions) (*Txop, error)
- func (c *Dbop) TExec(ctx context.Context, id string, param interface{}) (r sql.Result, e error)
- func (c *Dbop) TExecRtn(ctx context.Context, id string, param interface{}, h RowsExtractor) error
- func (c *Dbop) TQuery(ctx context.Context, id string, param interface{}, h RowsExtractor) error
- type ExtractFunc
- type Maker
- type Param
- type Rows
- type RowsExtractor
- type Rs
- type SqlTemplate
- type TExecer
- type TxBegin
- type TxEnd
- type Txop
- func (t *Txop) TCommit() error
- func (t *Txop) TExec(ctx context.Context, id string, param interface{}) (r sql.Result, e error)
- func (t *Txop) TExecRtn(ctx context.Context, id string, param interface{}, h RowsExtractor) error
- func (t *Txop) TQuery(ctx context.Context, id string, param interface{}, h RowsExtractor) error
- func (t *Txop) TRollback() error
Constants ¶
This section is empty.
Variables ¶
View Source
var DefaultTxOptions *sql.TxOptions = NewTxOptions(sql.LevelDefault, false)
Functions ¶
func MustConnect ¶
func MustExecRtn ¶
func MustExecRtn(execer TExecer, ctx context.Context, id string, param interface{}, h RowsExtractor)
func MustQuery ¶
func MustQuery(execer TExecer, ctx context.Context, id string, param interface{}, h RowsExtractor)
func NewTxOptions ¶
func NewTxOptions(level sql.IsolationLevel, readonly bool) *sql.TxOptions
Types ¶
type ExtractFunc ¶
func (ExtractFunc) Extract ¶
func (e ExtractFunc) Extract(rs Rows) error
type RowsExtractor ¶
type Rs ¶
func (*Rs) StructScan ¶
type SqlTemplate ¶
func NewSqlTemplate ¶
func NewSqlTemplate(pattern string) *SqlTemplate
func NewSqlTemplateWithFuncs ¶
func NewSqlTemplateWithFuncs(pattern string, funcs template.FuncMap) *SqlTemplate
func (*SqlTemplate) MakeSql ¶
func (t *SqlTemplate) MakeSql(id string, param interface{}) (string, error)
func (*SqlTemplate) SetDebug ¶
func (t *SqlTemplate) SetDebug(b bool)
Click to show internal directories.
Click to hide internal directories.