All checks were successful
continuous-integration/drone/push Build is passing
Replace MySQL driver with pgx/v5 and pgxpool: - Update sqlc to use postgresql engine - Convert query.sql to PostgreSQL syntax ($1 params, CASE WHEN, ANY() arrays) - Replace sql.DB with pgxpool.Pool throughout - Change nullable types from sql.Null* to pgtype.* - Update ID types from uint32 to int64 for PostgreSQL compatibility - Delete MySQL-specific dynamic_connect.go - Add opentelemetry.gowrap template for tracing
16 lines
446 B
Go
16 lines
446 B
Go
package ntpdb
|
|
|
|
//go:generate go tool github.com/hexdigest/gowrap/cmd/gowrap gen -t ./opentelemetry.gowrap -g -i QuerierTx -p . -o otel.go
|
|
|
|
import (
|
|
"context"
|
|
|
|
"github.com/jackc/pgx/v5/pgxpool"
|
|
"go.ntppool.org/common/database/pgdb"
|
|
)
|
|
|
|
// OpenDB opens a PostgreSQL connection pool using the specified config file
|
|
func OpenDB(ctx context.Context, configFile string) (*pgxpool.Pool, error) {
|
|
return pgdb.OpenPoolWithConfigFile(ctx, configFile)
|
|
}
|