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
Documentation about Context propagation for the new database context methods. For example, it isn't clear what happens in the following cases:
Does DB.BeginTx result in a Tx that has a context, or is the context only applied to the creation of the Tx?
Does DB.PrepareContext result in a Stmt that uses the passed in context? Phrased differently: does calling stmt.Exec() use the context passed to DB.PrepareContext ?
Similar to the above question, does Stmt.QueryContext use the context that was used to create it?
Does Tx.Prepare use the context that was used to create it? (
Reading the code clarifies that context is usually not passed around, but this isn't obvious from the docs. Furthermore, this does not make it clear if this is an implementation detail, or a part of the API.
Ideally, The database docs could include something along the lines of:
func (s *Stmt) Exec(args ... interface{}) (Result, error)
This is equivalent to
func (s *Stmt) ExecContext(context.Background(), args ...) (Result, error)
The text was updated successfully, but these errors were encountered:
We may be able to clarify these points, but I'm fairly certain that the documentation does in fact state all of these facts. Are you able to suggest better wording to clarify these details?
What version of Go are you using (
go version
)?Go 1.9
What did you expect to see?
Documentation about Context propagation for the new database context methods. For example, it isn't clear what happens in the following cases:
DB.BeginTx
result in aTx
that has a context, or is the context only applied to the creation of the Tx?DB.PrepareContext
result in aStmt
that uses the passed in context? Phrased differently: does callingstmt.Exec()
use the context passed toDB.PrepareContext
?Stmt.QueryContext
use the context that was used to create it?Tx.Prepare
use the context that was used to create it? (Reading the code clarifies that context is usually not passed around, but this isn't obvious from the docs. Furthermore, this does not make it clear if this is an implementation detail, or a part of the API.
Ideally, The database docs could include something along the lines of:
The text was updated successfully, but these errors were encountered: