Documentation ¶
Index ¶
- Variables
- type Connectionable
- type Executable
- type MultiScanner
- type Queryable
- type QueryableRow
- type Repository
- func (r *Repository) Begin(ctx context.Context) (Transactional, error)
- func (r *Repository) Exec(ctx context.Context, sql string, args ...interface{}) (int64, error)
- func (r *Repository) Query(ctx context.Context, sql string, args ...interface{}) (MultiScanner, error)
- func (r *Repository) QueryRow(ctx context.Context, sql string, args ...interface{}) Scanner
- type Row
- type Rows
- type Scanner
- type Transactional
- type Tx
- func (t *Tx) Begin(ctx context.Context) (Transactional, error)
- func (t *Tx) Commit(ctx context.Context) error
- func (t *Tx) Exec(ctx context.Context, sql string, args ...interface{}) (int64, error)
- func (t *Tx) Query(ctx context.Context, sql string, args ...interface{}) (MultiScanner, error)
- func (t *Tx) QueryRow(ctx context.Context, sql string, args ...interface{}) Scanner
- func (t *Tx) Rollback(ctx context.Context) error
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrNoRowsAffected = errors.New("no row affected")
ErrNoRowsAffected ...
View Source
var ErrNoRowsFound = errors.New("no rows found")
ErrNoRowsFound ...
View Source
var ErrTxClosed = errors.New("transaction closed")
ErrTxClosed ...
View Source
var ErrTxCommitRollback = errors.New("transaction commit rollback")
ErrTxCommitRollback ...
Functions ¶
This section is empty.
Types ¶
type Connectionable ¶
type Connectionable interface { QueryRow(ctx context.Context, sql string, args ...interface{}) Scanner Query(ctx context.Context, sql string, args ...interface{}) (MultiScanner, error) Exec(ctx context.Context, sql string, args ...interface{}) (int64, error) Begin(ctx context.Context) (Transactional, error) }
Connectionable ...
type Executable ¶
type Executable interface {
Exec(ctx context.Context, sql string, args ...interface{}) (int64, error)
}
Executable ...
type MultiScanner ¶
MultiScanner ...
type Queryable ¶
type Queryable interface {
Query(ctx context.Context, sql string, args ...interface{}) (MultiScanner, error)
}
Queryable ...
type QueryableRow ¶
type QueryableRow interface {
QueryRow(ctx context.Context, sql string, args ...interface{}) Scanner
}
QueryableRow ...
type Repository ¶
type Repository struct {
// contains filtered or unexported fields
}
Repository ...
func (*Repository) Begin ¶
func (r *Repository) Begin(ctx context.Context) (Transactional, error)
Begin ...
func (*Repository) Query ¶
func (r *Repository) Query(ctx context.Context, sql string, args ...interface{}) (MultiScanner, error)
Query ...
type Transactional ¶
type Transactional interface { Connectionable Commit(ctx context.Context) error Rollback(ctx context.Context) error }
Transactional ...
Click to show internal directories.
Click to hide internal directories.