feat: add postgres support (#215)

* feat: add postgres support and refactor

* feat: improve releases find

* fix: autobrrctl create user
This commit is contained in:
Ludvig Lundgren 2022-04-02 19:24:23 +02:00 committed by GitHub
parent f6873e932e
commit 3185832708
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
30 changed files with 1708 additions and 831 deletions

View file

@ -39,7 +39,7 @@ func main() {
}
// open database connection
db, _ := database.NewDB(domain.Config{ConfigPath: configPath})
db, _ := database.NewDB(domain.Config{ConfigPath: configPath, DatabaseType: "sqlite"})
if err := db.Open(); err != nil {
log.Fatal("could not open db connection")
}
@ -96,7 +96,7 @@ func main() {
}
user.Password = hashed
if err := userRepo.Store(context.Background(), *user); err != nil {
if err := userRepo.Update(context.Background(), *user); err != nil {
log.Fatalf("failed to create user: %v", err)
}
default: