mirror of
https://github.com/VinGarcia/ksql.git
synced 2025-05-31 11:42:25 +00:00
Remove unnecessary extra argument from ksql.NewWithAdapter
To be honest I don't know how it ended up there =P
This commit is contained in:
parent
af4eba4bf6
commit
268e3d3c36
7
ksql.go
7
ksql.go
@ -34,7 +34,7 @@ type DB struct {
|
|||||||
// from database/sql, i.e. if any struct implements the functions below
|
// from database/sql, i.e. if any struct implements the functions below
|
||||||
// with the exact same semantic as the sql package it will work with ksql.
|
// with the exact same semantic as the sql package it will work with ksql.
|
||||||
//
|
//
|
||||||
// To create a new client using this adapter use ksql.NewWithDB()
|
// To create a new client using this adapter use ksql.NewWithAdapter()
|
||||||
type DBAdapter interface {
|
type DBAdapter interface {
|
||||||
ExecContext(ctx context.Context, query string, args ...interface{}) (Result, error)
|
ExecContext(ctx context.Context, query string, args ...interface{}) (Result, error)
|
||||||
QueryContext(ctx context.Context, query string, args ...interface{}) (Rows, error)
|
QueryContext(ctx context.Context, query string, args ...interface{}) (Rows, error)
|
||||||
@ -96,7 +96,7 @@ func New(
|
|||||||
|
|
||||||
db.SetMaxOpenConns(config.MaxOpenConns)
|
db.SetMaxOpenConns(config.MaxOpenConns)
|
||||||
|
|
||||||
return NewWithAdapter(SQLAdapter{db}, dbDriver, connectionString)
|
return NewWithAdapter(SQLAdapter{db}, dbDriver)
|
||||||
}
|
}
|
||||||
|
|
||||||
// NewWithPGX instantiates a new KissSQL client using the pgx
|
// NewWithPGX instantiates a new KissSQL client using the pgx
|
||||||
@ -121,7 +121,7 @@ func NewWithPGX(
|
|||||||
return DB{}, err
|
return DB{}, err
|
||||||
}
|
}
|
||||||
|
|
||||||
db, err = NewWithAdapter(PGXAdapter{pool}, "postgres", connectionString)
|
db, err = NewWithAdapter(PGXAdapter{pool}, "postgres")
|
||||||
return db, err
|
return db, err
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -130,7 +130,6 @@ func NewWithPGX(
|
|||||||
func NewWithAdapter(
|
func NewWithAdapter(
|
||||||
db DBAdapter,
|
db DBAdapter,
|
||||||
dbDriver string,
|
dbDriver string,
|
||||||
connectionString string,
|
|
||||||
) (DB, error) {
|
) (DB, error) {
|
||||||
dialect := supportedDialects[dbDriver]
|
dialect := supportedDialects[dbDriver]
|
||||||
if dialect == nil {
|
if dialect == nil {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user