We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1fb5961 commit 55dba87Copy full SHA for 55dba87
src/database/sql/sql.go
@@ -2256,6 +2256,13 @@ var (
2256
2257
// Stmt is a prepared statement.
2258
// A Stmt is safe for concurrent use by multiple goroutines.
2259
+//
2260
+// If a Stmt is prepared on a Tx or Conn, it will be bound to a single
2261
+// underlying connection forever. If the Tx or Conn closes, the Stmt will
2262
+// become unusable and all operations will return an error.
2263
+// If a Stmt is prepared on a DB, it will remain usable for the lifetime of the
2264
+// DB. When the Stmt needs to execute on a new underlying connection, it will
2265
+// prepare itself on the new connection automatically.
2266
type Stmt struct {
2267
// Immutable:
2268
db *DB // where we came from
0 commit comments