psql first commit

This commit is contained in:
root
2023-04-25 15:14:42 +03:00
parent c96b6ed943
commit 15ab461a5e
49 changed files with 110 additions and 0 deletions

View File

@@ -0,0 +1,21 @@
package storage
import (
"github.com/spf13/viper"
"testing"
)
func TestNewPostgresqlStorage(t *testing.T) {
cfg := viper.New()
cfg.Set("storage.db.psql.host", "localhost")
cfg.Set("storage.db.psql.port", "5432")
cfg.Set("storage.db.psql.user", "postgres")
cfg.Set("storage.db.psql.password", "postgres")
cfg.Set("storage.db.psql.dbname", "mobilityaccounts")
storage, err := NewPostgresqlStorage(cfg)
if err != nil {
t.Errorf("error creating new PostgreSQL storage: %v", err)
}
defer storage.DbConnection.Close()
}