Documentation ¶
Index ¶
- Variables
- func IsTx(ctx context.Context) bool
- func IsolationLevel(ctx context.Context, isoLevel sql.IsolationLevel) context.Context
- func ReadOnly(ctx context.Context, readOnly bool) context.Context
- func RunInTx(ctx context.Context, db *sqlx.DB, opt *sql.TxOptions, ...) (err error)
- func TxOptions(ctx context.Context) *sql.TxOptions
- func WithValue(ctx context.Context, atm *Atomic) context.Context
- type Atomic
- type DBTX
- type Middleware
- type Option
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrIsTransaction = errors.New("sqltx: underlying type is transaction") ErrNestedTransaction = errors.New("sqltx: transactions cannot be nested") ErrNonTransaction = errors.New("sqltx: underlying type is not a transaction") )
View Source
var ErrContextNotFound = errors.New("sqltx: Atomic not found in context")
Functions ¶
func IsolationLevel ¶
Types ¶
type Atomic ¶
type Atomic struct {
// contains filtered or unexported fields
}
type DBTX ¶
type DBTX = sqlx.ExtContext
DBTX represents the common db operations for both *sql.DB and *sql.Tx.
type Middleware ¶
Click to show internal directories.
Click to hide internal directories.