Farhan Khan 6776cd28e5 Adding tests for instances
Minor modification to db code
2021-09-29 14:32:42 +00:00

20 lines
340 B
Go

package main
import (
"os"
"context"
"github.com/jackc/pgx/v4/pgxpool"
)
var pool *pgxpool.Pool
func getDbPool() *pgxpool.Pool {
// Setup Database
dburl := os.Getenv("DATABASE_URL")
pool, err := pgxpool.Connect(context.Background(), dburl)
if err != nil {
logFatal.Fatal("Unable to connect to database:", err)
}
return pool
}