Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrSQLTransactionNoTrx = errors.New("error on getting transaction context. no transaction available") ErrSQLTransactionFailedTrx = errors.New("error on performing transactional request") ErrSQLTransactionFailedCommit = errors.New("failed to commit transaction") )
transactional SQL error
Functions ¶
This section is empty.
Types ¶
type BaseStorage ¶
type BaseStorage struct {
Storage *connection.Store
}
func NewBaseStorage ¶
func NewBaseStorage(store *connection.Store) *BaseStorage
func (*BaseStorage) SetTxToContext ¶
set transaction to context
func (*BaseStorage) WithTransaction ¶
func (r *BaseStorage) WithTransaction(ctx context.Context, fn TransactionFunc) error
wrapper function to handle transaction process
type SQLQuery ¶
type SQLQuery interface { sqlx.Queryer GetContext(ctx context.Context, dest interface{}, query string, args ...interface{}) error SelectContext(ctx context.Context, dest interface{}, query string, args ...interface{}) error PrepareNamedContext(ctx context.Context, query string) (*sqlx.NamedStmt, error) }
type TransactionFunc ¶
Click to show internal directories.
Click to hide internal directories.