|
|
@@ -62,21 +62,21 @@ func (session *Session) queryRows(sqlStr string, args ...interface{}) (*core.Row
|
|
|
return nil, err
|
|
|
}
|
|
|
|
|
|
- rows, err := stmt.Query(args...)
|
|
|
+ rows, err := stmt.QueryContext(session.ctx, args...)
|
|
|
if err != nil {
|
|
|
return nil, err
|
|
|
}
|
|
|
return rows, nil
|
|
|
}
|
|
|
|
|
|
- rows, err := db.Query(sqlStr, args...)
|
|
|
+ rows, err := db.QueryContext(session.ctx, sqlStr, args...)
|
|
|
if err != nil {
|
|
|
return nil, err
|
|
|
}
|
|
|
return rows, nil
|
|
|
}
|
|
|
|
|
|
- rows, err := session.tx.Query(sqlStr, args...)
|
|
|
+ rows, err := session.tx.QueryContext(session.ctx, sqlStr, args...)
|
|
|
if err != nil {
|
|
|
return nil, err
|
|
|
}
|
|
|
@@ -290,7 +290,7 @@ func (session *Session) exec(sqlStr string, args ...interface{}) (sql.Result, er
|
|
|
}
|
|
|
|
|
|
if !session.isAutoCommit {
|
|
|
- return session.tx.Exec(sqlStr, args...)
|
|
|
+ return session.tx.ExecContext(session.ctx, sqlStr, args...)
|
|
|
}
|
|
|
|
|
|
if session.prepareStmt {
|
|
|
@@ -299,14 +299,14 @@ func (session *Session) exec(sqlStr string, args ...interface{}) (sql.Result, er
|
|
|
return nil, err
|
|
|
}
|
|
|
|
|
|
- res, err := stmt.Exec(args...)
|
|
|
+ res, err := stmt.ExecContext(session.ctx, args...)
|
|
|
if err != nil {
|
|
|
return nil, err
|
|
|
}
|
|
|
return res, nil
|
|
|
}
|
|
|
|
|
|
- return session.DB().Exec(sqlStr, args...)
|
|
|
+ return session.DB().ExecContext(session.ctx, sqlStr, args...)
|
|
|
}
|
|
|
|
|
|
func convertSQLOrArgs(sqlorArgs ...interface{}) (string, []interface{}, error) {
|