This commit is contained in:
Lev Zakharov 2023-06-01 10:40:19 +03:00
parent 8c92f70527
commit c75ecb4d90
2 changed files with 6 additions and 6 deletions

View File

@ -375,8 +375,8 @@ func (db *DB) AddError(err error) error {
func (db *DB) DB() (*sql.DB, error) {
connPool := db.ConnPool
if connector, ok := connPool.(SQLConnector); ok && connector != nil {
return connector.GetSQLConn(db)
if connector, ok := connPool.(GetDBConnectorWithContext); ok && connector != nil {
return connector.GetDBConnWithContext(db)
}
if dbConnector, ok := connPool.(GetDBConnector); ok && dbConnector != nil {

View File

@ -77,10 +77,10 @@ type GetDBConnector interface {
GetDBConn() (*sql.DB, error)
}
// SQLConnector represents SQL db connector which takes into account the current
// database context
type SQLConnector interface {
GetSQLConn(db *DB) (*sql.DB, error)
// GetDBConnectorWithContext represents SQL db connector which takes into
// account the current database context
type GetDBConnectorWithContext interface {
GetDBConnWithContext(db *DB) (*sql.DB, error)
}
// Rows rows interface