Documentation
¶
Index ¶
- type BaseConn
- func (conn *BaseConn) ApplyRetryStrategy(tctx *tcontext.Context, params retry.Params, ...) (interface{}, int, error)
- func (conn *BaseConn) Close() error
- func (conn *BaseConn) ExecuteSQL(tctx *tcontext.Context, queries []string, args ...[]interface{}) (int, error)
- func (conn *BaseConn) ExecuteSQLWithIgnoreError(tctx *tcontext.Context, ignoreErr func(error) bool, queries []string, ...) (int, error)
- func (conn *BaseConn) QuerySQL(tctx *tcontext.Context, query string, args ...interface{}) (*sql.Rows, error)
- func (conn *BaseConn) ResetConn(tctx *tcontext.Context) error
- func (conn *BaseConn) SetRetryStrategy(strategy retry.Strategy) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BaseConn ¶
BaseConn wraps a connection to DB
func NewBaseConn ¶
NewBaseConn builds BaseConn to connect real DB
func (*BaseConn) ApplyRetryStrategy ¶
func (conn *BaseConn) ApplyRetryStrategy(tctx *tcontext.Context, params retry.Params, operateFn func(*tcontext.Context) (interface{}, error)) (interface{}, int, error)
ApplyRetryStrategy apply specify strategy for BaseConn
func (*BaseConn) ExecuteSQL ¶
func (conn *BaseConn) ExecuteSQL(tctx *tcontext.Context, queries []string, args ...[]interface{}) (int, error)
ExecuteSQL executes sql on real DB, return 1. failed: (the index of sqls executed error, error) 2. succeed: (len(sqls), nil)
func (*BaseConn) ExecuteSQLWithIgnoreError ¶
func (conn *BaseConn) ExecuteSQLWithIgnoreError(tctx *tcontext.Context, ignoreErr func(error) bool, queries []string, args ...[]interface{}) (int, error)
ExecuteSQLWithIgnoreError executes sql on real DB, and will ignore some error and continue execute the next query. return 1. failed: (the index of sqls executed error, error) 2. succeed: (len(sqls), nil)
func (*BaseConn) QuerySQL ¶
func (conn *BaseConn) QuerySQL(tctx *tcontext.Context, query string, args ...interface{}) (*sql.Rows, error)
QuerySQL defines query statement, and connect to real DB
Click to show internal directories.
Click to hide internal directories.