From 57689dfd7dfe2e3c6efea53b67ad57820683b3b9 Mon Sep 17 00:00:00 2001 From: Eugene Triguba Date: Sun, 10 Mar 2024 15:54:35 -0400 Subject: Add adapters and remove upperdb --- internal/commands/down.go | 4 ++-- internal/commands/status.go | 4 ++-- internal/commands/up.go | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) (limited to 'internal/commands') diff --git a/internal/commands/down.go b/internal/commands/down.go index 0ba3abb..f991c69 100644 --- a/internal/commands/down.go +++ b/internal/commands/down.go @@ -54,12 +54,12 @@ func (cmd *DownCmd) Execute( return subcommands.ExitFailure } - db, err := storage.DBConnect(cfg.Connection) + db, err := storage.NewDB(cfg.Connection) if err != nil { consoleOutputter.Error(fmt.Errorf("unable to connect to database: %w", err)) return subcommands.ExitFailure } - defer db.Session.Close() + defer db.Close() migrationDBRepo, err := repositories.NewMigrationDBRepo(db) if err != nil { diff --git a/internal/commands/status.go b/internal/commands/status.go index d44a132..1e176b9 100644 --- a/internal/commands/status.go +++ b/internal/commands/status.go @@ -44,12 +44,12 @@ func (m *StatusCmd) Execute( return subcommands.ExitFailure } - db, err := storage.DBConnect(cfg.Connection) + db, err := storage.NewDB(cfg.Connection) if err != nil { consoleOutputter.Error(fmt.Errorf("unable to connect to database: %w", err)) return subcommands.ExitFailure } - defer db.Session.Close() + defer db.Close() migrationDBRepo, err := repositories.NewMigrationDBRepo(db) if err != nil { diff --git a/internal/commands/up.go b/internal/commands/up.go index a203d2e..77e0b8d 100644 --- a/internal/commands/up.go +++ b/internal/commands/up.go @@ -54,12 +54,12 @@ func (cmd *UpCmd) Execute( return subcommands.ExitFailure } - db, err := storage.DBConnect(cfg.Connection) + db, err := storage.NewDB(cfg.Connection) if err != nil { consoleOutputter.Error(fmt.Errorf("unable to connect to database: %w", err)) return subcommands.ExitFailure } - defer db.Session.Close() + defer db.Close() migrationDBRepo, err := repositories.NewMigrationDBRepo(db) if err != nil { -- cgit v1.2.3