Nexus/pkg/internal/database/connect.go

17 lines
217 B
Go
Raw Normal View History

2024-10-20 11:04:41 +00:00
package database
import (
"database/sql"
_ "github.com/lib/pq"
)
var Kdb *sql.DB
func Connect(str string) (*sql.DB, error) {
db, err := sql.Open("postgres", str)
if err == nil {
Kdb = db
}
return db, err
}