You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
boundary/internal/db/common/db.go

16 lines
258 B

package common
import (
"database/sql"
_ "github.com/jackc/pgx/v4"
)
func SqlOpen(driverName, dataSourceName string) (*sql.DB, error) {
switch driverName {
case "postgres", "pgx":
driverName = "pgx"
}
return sql.Open(driverName, dataSourceName)
}