From c75ecb4d9027c254c73588cb3f3b45087a62fd47 Mon Sep 17 00:00:00 2001 From: Lev Zakharov Date: Thu, 1 Jun 2023 10:40:19 +0300 Subject: [PATCH] rename --- gorm.go | 4 ++-- interfaces.go | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/gorm.go b/gorm.go index 51791caf..7a3794c4 100644 --- a/gorm.go +++ b/gorm.go @@ -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 { diff --git a/interfaces.go b/interfaces.go index ce62508a..1950d740 100644 --- a/interfaces.go +++ b/interfaces.go @@ -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