luna-duclos / instrumentedsql

A sql driver that will wrap any other driver and log/trace all its calls
MIT License
173 stars 44 forks source link

Fixes issue #41 (NumInput() returns -1 with NamedValueChecker) #42

Closed nvx closed 3 years ago

nvx commented 3 years ago

Do not implement driver.ColumnConverter on go1.9+ as the act of implementing this interface causes a side effect with a compatibility wrapper. Instead only implement the replacement driver.NamedValueChecker interface on go1.19+ and handle compatibility with drivers implementing driver.ColumnConverter ourselves to avoid the unintentional side effects from happening when driver.ColumnConverter is not implemented by the underlying driver.

As an aside, I noticed a number of files are missing their trailing new lines and do not follow go fmt formatting. I've only run go fmt on files I edited to avoid unnecessary conflicts, but this should probably be run across the whole repo.

nvx commented 3 years ago

Note that ccChecker and callValuerValue is a copy-paste from Go1.15 database/sql. I'm not sure if there's any licencing implications for this (I imagine the Golang licence is compatible with the MIT licence of instrumentedsql, but I am not a lawyer of course).

luna-duclos commented 3 years ago

Thank you so much! Merged :)

dolmen commented 3 years ago

Time for a release?