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
Does this issue reproduce with the latest release?
Yes
What operating system and processor architecture are you using (go env)?
Irrelevant, reproducible on playground.
What did you do?
I'm implementing a database/sql.Driver with the new context API for a database that doesn't support prepared statements.
In my first attempt (playground) where I only implemented the QueryerContext interface, database/sql called Prepare() and my driver panic'd since it was unsupported. I expected QueryerContext to be sufficient to call database/sql.DB.Query() without Prepare() since the docs say
If a Conn does not implement QueryerContext, the sql package's DB.Query will first prepare a query, execute the statement, and then close the statement.
After more investigation, it seems like you need to implement the (deprecated) Queryer interface, too, in order to skip prepared statements even though its methods are not called. See my successful example (playground). This was unexpected since the docs say
Deprecated: Drivers should implement QueryerContext instead (or additionally).
Is this expected? Am I misunderstanding the docs? Happy to submit a patch if it's a bug :-)
The text was updated successfully, but these errors were encountered:
What version of Go are you using (
go version
)?go1.9
Does this issue reproduce with the latest release?
Yes
What operating system and processor architecture are you using (
go env
)?Irrelevant, reproducible on playground.
What did you do?
I'm implementing a
database/sql.Driver
with the new context API for a database that doesn't support prepared statements.In my first attempt (playground) where I only implemented the QueryerContext interface,
database/sql
calledPrepare()
and my driver panic'd since it was unsupported. I expected QueryerContext to be sufficient to calldatabase/sql.DB.Query()
withoutPrepare()
since the docs sayAfter more investigation, it seems like you need to implement the (deprecated) Queryer interface, too, in order to skip prepared statements even though its methods are not called. See my successful example (playground). This was unexpected since the docs say
Is this expected? Am I misunderstanding the docs? Happy to submit a patch if it's a bug :-)
The text was updated successfully, but these errors were encountered: