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/bolttest/db.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'internal/bolttest') diff --git a/internal/bolttest/db.go b/internal/bolttest/db.go index a4e1115..639adb8 100644 --- a/internal/bolttest/db.go +++ b/internal/bolttest/db.go @@ -12,11 +12,11 @@ import ( func NewTestDB(t *testing.T) storage.DB { connectionConfig := NewTestConnectionConfig() - testdb, err := storage.DBConnect(connectionConfig) + testdb, err := storage.NewDB(connectionConfig) assert.Nil(t, err) t.Cleanup(func() { DropTable(t, testdb, "bolt_migrations") - assert.Nil(t, testdb.Session.Close()) + assert.Nil(t, testdb.Close()) }) return testdb } @@ -26,12 +26,13 @@ func NewTestConnectionConfig() configloader.ConnectionConfig { Driver: os.Getenv("BOLT_DB_CONN_DRIVER"), DBName: os.Getenv("BOLT_DB_CONN_DBNAME"), Host: os.Getenv("BOLT_DB_CONN_HOST"), + Port: os.Getenv("BOLT_DB_CONN_PORT"), User: os.Getenv("BOLT_DB_CONN_USER"), Password: os.Getenv("BOLT_DB_CONN_PASSWORD"), } } func DropTable(t *testing.T, testdb storage.DB, tableName string) { - _, err := testdb.Session.SQL().Exec(fmt.Sprintf(`DROP TABLE IF EXISTS %s;`, tableName)) + _, err := testdb.Exec(fmt.Sprintf("DROP TABLE IF EXISTS %s;", tableName)) assert.Nil(t, err) } -- cgit v1.2.3