GetDBConn returns the underlying *sql.DB connection
()
| 37 | |
| 38 | // GetDBConn returns the underlying *sql.DB connection |
| 39 | func (db *PreparedStmtDB) GetDBConn() (*sql.DB, error) { |
| 40 | if sqldb, ok := db.ConnPool.(*sql.DB); ok { |
| 41 | return sqldb, nil |
| 42 | } |
| 43 | |
| 44 | if dbConnector, ok := db.ConnPool.(GetDBConnector); ok && dbConnector != nil { |
| 45 | return dbConnector.GetDBConn() |
| 46 | } |
| 47 | |
| 48 | return nil, ErrInvalidDB |
| 49 | } |
| 50 | |
| 51 | // Close closes all prepared statements in the store |
| 52 | func (db *PreparedStmtDB) Close() { |