Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrNotInTransaction is returned when using Commit // outside of a transaction. ErrNotInTransaction = errors.New("not in transaction") // ErrIncompatibleOption is returned when using an option incompatible // with the selected driver. ErrIncompatibleOption = errors.New("incompatible option") // ErrInvalidGormDB is returned when a nil Gorm DB is used to // initialise Gormx ErrInvalidGormDB = errors.New("invalid Gorm DB") // ErrInvalidGormDBConfig is returned when a nil Gorm DB config is used to // initialise Gormx ErrInvalidGormDBConfig = errors.New("invalid Gorm DB config") )
Functions ¶
This section is empty.
Types ¶
type Gormx ¶
type Gormx interface {
// Ping tests the underlying sql connection.
Ping() error
// Close the underlying sql connection.
Close() error
// Begin a new transaction.
Beginx() *gormx
// Begin a new transaction using the provided context and options.
// Note that the provided parameters are only used when opening a new transaction,
// not on nested ones.
BeginTxx(ctx context.Context) *gormx
// Rollback the associated transaction.
Rollbackx() error
// Commit the assiociated transaction.
Commitx() error
// Gorm returns the underlying Gorm DB.
Gorm() *gorm.DB
// Tx returns the underlying transaction.
Tx() *gorm.DB
}
Gormx is a gorm db wrapper that can manage nested transactions.
Click to show internal directories.
Click to hide internal directories.