Added function to get selected sql instance
This commit is contained in:
parent
465c0e7973
commit
6f95fedbc1
1 changed files with 11 additions and 0 deletions
|
|
@ -2,6 +2,7 @@ package SQL
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/google/uuid"
|
"github.com/google/uuid"
|
||||||
|
"scabiosa/Tools"
|
||||||
"time"
|
"time"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
@ -21,4 +22,14 @@ func NewLogEntry(sqlService SQLService, uuid uuid.UUID, logType LogType, backupN
|
||||||
|
|
||||||
func NewBackupEntry(sqlService SQLService, uuid uuid.UUID, backupName string, lastBackup time.Time, localBackup bool, filePath string, storageType RemoteStorageType, remotePath string, durationToBackup time.Duration, hadErrors bool){
|
func NewBackupEntry(sqlService SQLService, uuid uuid.UUID, backupName string, lastBackup time.Time, localBackup bool, filePath string, storageType RemoteStorageType, remotePath string, durationToBackup time.Duration, hadErrors bool){
|
||||||
sqlService.newBackupEntry(uuid, backupName, lastBackup, localBackup, filePath, storageType, remotePath, durationToBackup, hadErrors)
|
sqlService.newBackupEntry(uuid, backupName, lastBackup, localBackup, filePath, storageType, remotePath, durationToBackup, hadErrors)
|
||||||
|
}
|
||||||
|
|
||||||
|
func GetSQLInstance() SQLService{
|
||||||
|
config := Tools.GetConfig()
|
||||||
|
|
||||||
|
switch config.SQLConfig.SqlType {
|
||||||
|
case "mariadb": {return GetMariaDBInstance()}
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil
|
||||||
}
|
}
|
||||||
Reference in a new issue