Documentation
¶
Overview ¶
Package transaction provides mockable interfaces of sql package struct types.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client interface {
Exec(query string, args ...any) (sql.Result, error)
Stmt(stmt *sql.Stmt) Stmt
}
Client is an interface over a subset of sql.Tx methods rationale 1: explicitly forbid direct access to Commit and Rollback functionality as that is exclusively dealt with by WithTransaction in ../db rationale 2: allow mocking
type Stmt ¶
type Stmt interface {
Exec(args ...any) (sql.Result, error)
Query(args ...any) (*sql.Rows, error)
QueryContext(ctx context.Context, args ...any) (*sql.Rows, error)
QueryRowContext(ctx context.Context, args ...any) *sql.Row
}
Stmt is an interface over a subset of sql.Stmt methods rationale: allow mocking
Click to show internal directories.
Click to hide internal directories.