Closed slnt closed 2 years ago
You can get access to the driver via db.Driver()
.
db, _, err := sqlmock.New()
drv := db.Driver()
Hi, It seems @dolmen answered your question & this thread has been inactive for a while so I will be closing this.
I am using the package sqlmw to write an interceptor that adds logging and tracing to an arbitrary underlying driver. I'd like to test this with
sqlmock
but am running into a roadblock due to the fact that thesqlmw.Driver
functions requires adriver.Driver
. The driver that is implemented insqlmock
, however, is unexported, making the use of the library rather tricky... I'm not sure about what the RightWay™ might be to expose the underlying driver implementation that Sqlmock uses, especially such that it is openable bysql.Open
.