mirror of
https://github.com/idanoo/autobrr
synced 2025-07-23 00:39:13 +00:00
feat: add postgres support (#215)
* feat: add postgres support and refactor * feat: improve releases find * fix: autobrrctl create user
This commit is contained in:
parent
f6873e932e
commit
3185832708
30 changed files with 1708 additions and 831 deletions
|
@ -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:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue