Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MySQLService ¶
type MySQLService struct {
// contains filtered or unexported fields
}
MySQLService manages MySQL database connections
func NewMySQLService ¶
func NewMySQLService(cfg *config.Config) (*MySQLService, error)
NewMySQLService creates a new instance of MySQLService with advanced configurations
func (*MySQLService) Close ¶
func (dbService *MySQLService) Close()
Close closes the database connection gracefully
func (*MySQLService) GetDB ¶
func (dbService *MySQLService) GetDB() *sql.DB
GetDB returns the underlying *sql.DB instance
func (*MySQLService) HealthCheck ¶
func (dbService *MySQLService) HealthCheck() error
HealthCheck performs a health check by pinging the database
func (*MySQLService) LogStats ¶
func (dbService *MySQLService) LogStats()
LogStats logs the current connection pool statistics
type PgxDatabaseService ¶
type PgxDatabaseService struct {
// contains filtered or unexported fields
}
func NewPgxDatabaseService ¶
func NewPgxDatabaseService(cfg *config.Config) (*PgxDatabaseService, error)
NewPgxDatabaseService initializes a new database service using pgxpool
func (*PgxDatabaseService) Close ¶
func (db *PgxDatabaseService) Close()
func (*PgxDatabaseService) GetDB ¶
func (db *PgxDatabaseService) GetDB() *pgxpool.Pool
func (*PgxDatabaseService) HealthCheck ¶
func (db *PgxDatabaseService) HealthCheck() error
func (*PgxDatabaseService) LogStats ¶
func (db *PgxDatabaseService) LogStats()
Click to show internal directories.
Click to hide internal directories.