1
0
Fork 0

Elevate queryer type

master
Philip O'Toole 1 year ago
parent 3d652d929e
commit 497c6b3340

@ -543,13 +543,14 @@ func (db *DB) Query(req *command.Request, xTime bool) ([]*command.QueryRows, err
return db.queryWithConn(req, xTime, conn)
}
type queryer interface {
QueryContext(ctx context.Context, query string, args ...interface{}) (*sql.Rows, error)
}
func (db *DB) queryWithConn(req *command.Request, xTime bool, conn *sql.Conn) ([]*command.QueryRows, error) {
var err error
type Queryer interface {
QueryContext(ctx context.Context, query string, args ...interface{}) (*sql.Rows, error)
}
var queryer Queryer
var queryer queryer
var tx *sql.Tx
if req.Transaction {
stats.Add(numQTx, 1)
@ -621,10 +622,6 @@ func (db *DB) queryWithConn(req *command.Request, xTime bool, conn *sql.Conn) ([
return allRows, err
}
type queryer interface {
QueryContext(ctx context.Context, query string, args ...interface{}) (*sql.Rows, error)
}
func (db *DB) queryStmtWithConn(stmt *command.Statement, xTime bool, q queryer) (*command.QueryRows, error) {
rows := &command.QueryRows{}
start := time.Now()

Loading…
Cancel
Save