remove method Connect in kontor-echo

This commit is contained in:
2026-01-03 13:38:27 +01:00
parent 4d93f51767
commit 73f92f6770
3 changed files with 10 additions and 55 deletions
-19
View File
@@ -11,25 +11,6 @@ import (
var DB *bun.DB
func Connect() error {
var err error
dsn := "postgres://kontor:kontor@postgres:5432/kontor?sslmode=disable"
sqldb := sql.OpenDB(pgdriver.NewConnector(pgdriver.WithDSN(dsn)))
sqldb.SetMaxOpenConns(4)
sqldb.SetMaxIdleConns(4)
DB := bun.NewDB(sqldb, pgdialect.New())
if err = DB.Ping(); err != nil {
return err
}
log.Println("Connection Opened to Database")
return nil
}
func GetDatabase() (*bun.DB, error) {
var err error