diff options
| author | Eugene Triguba <eugenetriguba@gmail.com> | 2024-03-10 15:54:35 -0400 |
|---|---|---|
| committer | Eugene Triguba <eugenetriguba@gmail.com> | 2024-03-10 15:54:35 -0400 |
| commit | 57689dfd7dfe2e3c6efea53b67ad57820683b3b9 (patch) | |
| tree | 3e008fc4c0a0baa5d1c44ced357110be223de82a /internal/commands | |
| parent | Update readme (diff) | |
| download | cli-57689dfd7dfe2e3c6efea53b67ad57820683b3b9.zip | |
Add adapters and remove upperdb
Diffstat (limited to 'internal/commands')
| -rw-r--r-- | internal/commands/down.go | 4 | ||||
| -rw-r--r-- | internal/commands/status.go | 4 | ||||
| -rw-r--r-- | internal/commands/up.go | 4 |
3 files changed, 6 insertions, 6 deletions
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 { |