renommage lassistanoque
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
package database
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"trankilou.fr/lassistanoque/backend/internal/adapter/database/turso"
|
||||
"trankilou.fr/lassistanoque/backend/internal/config"
|
||||
"trankilou.fr/lassistanoque/backend/internal/domain"
|
||||
)
|
||||
|
||||
type Database interface {
|
||||
SettingsReporitory() domain.SettingsRepository
|
||||
UserReporitory() domain.UserRepository
|
||||
Migrate() error
|
||||
Close()
|
||||
}
|
||||
|
||||
func GetDatabase() (Database, error) {
|
||||
cfg := config.GetConfig()
|
||||
switch cfg.DatabaseType {
|
||||
case "turso":
|
||||
return turso.NewTursoDB(cfg)
|
||||
default:
|
||||
}
|
||||
return nil, fmt.Errorf("Database %s not implemented", cfg.DatabaseType)
|
||||
}
|
||||
Reference in New Issue
Block a user