func Connect(dbConfig config.Database) *gorm.DB {
	connectionStr := fmt.Sprintf("host=%s port=%s user=%s dbname=%s password=%s sslmode=disable", dbConfig.Host, dbConfig.Port, dbConfig.Username, dbConfig.Name, dbConfig.Password)
	db := tryConnection(connectionStr)
	log.Infoln("Successfully connected to Database")
	return db
}
Establish connection to the Postgres Database
package persistence
import (
	"fmt"
	"github.com/limechain/hedera-eth-bridge-validator/app/persistence/entity"
	"github.com/limechain/hedera-eth-bridge-validator/config"
	log "github.com/sirupsen/logrus"
	"gorm.io/driver/postgres"
	"gorm.io/gorm"
	"gorm.io/gorm/logger"
	"time"
)
type Database struct {
	connection *gorm.DB
}
func (db *Database) GetConnection() *gorm.DB {
	return db.connection
}
func NewDatabase(config config.Database) *Database {
	return &Database{
		connection: ConnectWithMigration(config),
	}
}