Documentation
¶
Index ¶
- Variables
- func AddPragmaToSQLite(connString string) (string, error)
- func CheckDeadlockLoggingEnabled(db *gorm.DB) (bool, error)
- func DoRetry(ctx context.Context, f func() error) error
- func EnableDeadlockLogging(db *gorm.DB) error
- func GetDataLockWaits(db *gorm.DB) ([]map[string]interface{}, error)
- func GetLockWaitTransactions(db *gorm.DB) ([]map[string]interface{}, error)
- func OpenFromCLI(c *cli.Context) (*gorm.DB, io.Closer, error)
- func OpenWithLogger(connString string) (*gorm.DB, io.Closer, error)
- func PrintDeadlockInfo(db *gorm.DB) string
Constants ¶
This section is empty.
Variables ¶
var ( ErrInmemoryWithHighConcurrency = errors.New("cannot use in-memory database with concurrency > 1") ErrDatabaseNotSupported = errors.New("database not supported") )
Functions ¶
func AddPragmaToSQLite ¶ added in v0.4.0
func CheckDeadlockLoggingEnabled ¶
CheckDeadlockLoggingEnabled checks if innodb_print_all_deadlocks is enabled.
func EnableDeadlockLogging ¶
EnableDeadlockLogging enables logging of all deadlocks to the MySQL error log. By default, MySQL/MariaDB only logs the most recent deadlock. This setting persists until the server is restarted.
func GetDataLockWaits ¶
GetDataLockWaits returns current lock wait information from performance_schema. This requires MySQL 8.0.30+ or MariaDB 10.5+.
func GetLockWaitTransactions ¶
GetLockWaitTransactions returns transactions currently waiting for locks. This requires MySQL 8.0.30+ or MariaDB 10.5+.
func OpenWithLogger ¶ added in v0.3.0
func PrintDeadlockInfo ¶
PrintDeadlockInfo prints detailed deadlock information from MySQL/MariaDB InnoDB status. This should be called when a deadlock error is detected to help diagnose the issue. Returns the deadlock information as a string, or empty string if not available.
Types ¶
This section is empty.