GORM provides the method DB
which returns a generic database interface *sql.DB from the current *gorm.DB
connection
// Get generic database object sql.DB to use its functions |
NOTE If the underlying database connection is not a *sql.DB
, like in a transaction, it will return nil
Connection Pool
// SetMaxIdleConns sets the maximum number of connections in the idle connection pool. |