Files

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

18 lines
330 B
Go
Raw Permalink Normal View History

// Copyright IBM Corp. 2020, 2026
2023-02-02 17:15:17 -08:00
// 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)
}