An abstraction layer for coordinating database transaction boundaries across multiple Go database drivers.
Go Transaction Manager is a Go library that provides an abstraction layer for coordinating database transaction boundaries across multiple database drivers. It solves the problem of managing transactions consistently when working with different database libraries like sqlx, GORM, MongoDB, and Redis, enabling clean repository patterns and complex transaction scenarios.
Go developers building applications that interact with multiple database systems or need consistent transaction management across different ORMs and database drivers.
Developers choose this library because it provides a unified transaction interface that works across popular Go database libraries, reduces boilerplate code, supports nested transactions, and enables clean architecture patterns like the repository pattern.
Transaction manager for GoLang
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Provides a consistent transaction interface across popular Go libraries like sqlx, GORM, MongoDB, and Redis, as detailed in the supported implementations list.
Enables complex transaction boundaries with support for nested transactions using different managers, demonstrated in the example code with nested Do calls.
Leverages Go contexts for transaction state and isolation, integral to the library's design for clean coordination across operations.
Includes mechanisms like ErrSkip and Skippable to control rollback behavior for specific errors, reducing boilerplate in error management as highlighted in the README.
Setting up for multi-database transactions or nested scenarios requires additional steps like CtxKey and ChainedMW, increasing initial setup effort and potential for misconfiguration.
Only guarantees compatibility with the two most recent Go versions, with critical bug fixes prioritized for newer releases, which may leave projects on older versions vulnerable.
Relies on old dependencies for backward compatibility, necessitating manual version fixes as described in the contribution section, adding maintenance burden and risk of conflicts.