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.

18 lines
329 B
Go
Raw Normal View History

2023-02-02 17:15:17 -08:00
// Copyright (c) HashiCorp, Inc.
// SPDX-License-Identifier: BUSL-1.1
package common
import (
"database/sql"
_ "github.com/jackc/pgx/v5"
)
func SqlOpen(driverName, dataSourceName string) (*sql.DB, error) {
switch driverName {
case "postgres", "pgx":
driverName = "pgx"
}
return sql.Open(driverName, dataSourceName)
}