Simplify NewWithPGX() function

pull/2/head 1.0.1
Vinícius Garcia 2021-08-01 15:04:47 -03:00
parent 5c2b981696
commit 37298e2c24
2 changed files with 3 additions and 4 deletions

View File

@ -52,7 +52,7 @@ func BenchmarkInsert(b *testing.B) {
})
})
pgxDB, err := ksql.NewWithPGX(ctx, driver, connStr, ksql.Config{
pgxDB, err := ksql.NewWithPGX(ctx, connStr, ksql.Config{
MaxOpenConns: 1,
})
if err != nil {
@ -165,7 +165,7 @@ func BenchmarkQuery(b *testing.B) {
})
})
pgxDB, err := ksql.NewWithPGX(ctx, driver, connStr, ksql.Config{
pgxDB, err := ksql.NewWithPGX(ctx, connStr, ksql.Config{
MaxOpenConns: 1,
})
if err != nil {

View File

@ -103,7 +103,6 @@ func New(
// library in the backend
func NewWithPGX(
ctx context.Context,
dbDriver string,
connectionString string,
config Config,
) (db DB, err error) {
@ -122,7 +121,7 @@ func NewWithPGX(
return DB{}, err
}
db, err = NewWithAdapter(PGXAdapter{pool}, dbDriver, connectionString)
db, err = NewWithAdapter(PGXAdapter{pool}, "postgres", connectionString)
return db, err
}