I reviewed the stdlib a bit more, and the driver connection is the “db connection” (upon which statements are run - these are handed out) and these are tracked:
https://github.com/golang/go/blob/ad3ccd92e4c2ddfc1499a5e038eb0aa0012c0dda/src/database/sql/sql.go#L1447 https://github.com/golang/go/blob/ad3ccd92e4c2ddfc1499a5e038eb0aa0012c0dda/src/database/sql/sql.go#L750 > On Nov 6, 2025, at 3:54 PM, Toby Allsopp <[email protected]> wrote: > > On Thursday, 6 November 2025 at 17:32:02 UTC+13 Sean Liao wrote: > I agree then that the docs don't match the current behavior, open an issue. > Less clear to me is whether the fix is to change the docs or change the > behavior to match the current docs. > But the current design certainly doesn't hold references to conns that have > been handed out. > > Thanks. I think it's pretty unlikely that the behavior can be changed at this > point. It could be useful to add an additional method like > CloseAndWait(context.Context) error, but I'd be happy if the documentation > for the existing behavior was made clearer. > > Cheers, > Toby. > > -- > You received this message because you are subscribed to the Google Groups > "golang-nuts" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected] > <mailto:[email protected]>. > To view this discussion visit > https://groups.google.com/d/msgid/golang-nuts/d3585166-9eb9-4546-b1a8-be231afe89bcn%40googlegroups.com > > <https://groups.google.com/d/msgid/golang-nuts/d3585166-9eb9-4546-b1a8-be231afe89bcn%40googlegroups.com?utm_medium=email&utm_source=footer>. -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion visit https://groups.google.com/d/msgid/golang-nuts/5CC390D3-9EB1-4124-8920-598DAB118A26%40ix.netcom.com.
