Files
threshold/internal/db/common/db.go
T

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

15 lines
258 B
Go
Raw Normal View History

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)
}