diff options
Diffstat (limited to 'common/config.go')
| -rw-r--r-- | common/config.go | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/common/config.go b/common/config.go index 8cb74ab..5519690 100644 --- a/common/config.go +++ b/common/config.go @@ -1,12 +1,12 @@ package common import ( + "database/sql" "fmt" "os" + _ "github.com/lib/pq" "github.com/pelletier/go-toml/v2" - "gorm.io/driver/postgres" - "gorm.io/gorm" ) type Config struct { @@ -31,12 +31,8 @@ func (p *PostgresConfig) SetDefaultValues() { p.Port = 5432 } -func (p *PostgresConfig) Connect() (*gorm.DB, error) { - db, err := gorm.Open(postgres.Open(p.generateDsn()), &gorm.Config{}) - if err != nil { - return nil, err - } - return db, nil +func (p *PostgresConfig) Connect() (*sql.DB, error) { + return sql.Open("postgres", p.generateDsn()) } // generateDsn for the connection to postgres using the given config.SQLCredentials |
