You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have implemented an instance of an sql/driver with a Conn instance that satisfies the ExecerContext interface. But unless the Conn also satisfies the Execer interfaces respectfully, the *Context versions are never called.
(Note, the same issue exists with respect to QueryerContext and Queryer, but for simplicity I will only discuss Execer/Context)
Further, when both Execer and ExecerContext are satisfied, or both Queryer and QueryerContext are satisfied, the non-Context version is never called, meaning all drivers that wish to satisfy the Context version must also define a useless non-Context version (example).
What did you expect to see?
I expected that implementing an ExecerContext would be sufficient to satisfy the documented "optional" nature of the interface.
What did you see instead?
I was required to also satisify the Execer interface, even though this requirement is not to my knowledge documented, nor should it be functionally necessary.
Suggestion:
Re-factor the database/sql package to require only one of the interfaces to be satisfied, not both.
The text was updated successfully, but these errors were encountered:
What version of Go are you using (
go version
)?Go 1.8.3
What did you do?
I have implemented an instance of an
sql/driver
with aConn
instance that satisfies the ExecerContext interface. But unless theConn
also satisfies theExecer
interfaces respectfully, the*Context
versions are never called.(Note, the same issue exists with respect to
QueryerContext
andQueryer
, but for simplicity I will only discuss Execer/Context)Further, when both
Execer
andExecerContext
are satisfied, or bothQueryer
andQueryerContext
are satisfied, the non-Context
version is never called, meaning all drivers that wish to satisfy theContext
version must also define a useless non-Context
version (example).What did you expect to see?
I expected that implementing an
ExecerContext
would be sufficient to satisfy the documented "optional" nature of the interface.What did you see instead?
I was required to also satisify the
Execer
interface, even though this requirement is not to my knowledge documented, nor should it be functionally necessary.Suggestion:
Re-factor the
database/sql
package to require only one of the interfaces to be satisfied, not both.The text was updated successfully, but these errors were encountered: