top | item 43082475

(no title)

benstigsen | 1 year ago

I noted this on my website, some time ago [1]:

> Making use of sql.DB from multiple goroutines is safe, since Go manages its own internal mutex.

Then I quote the database/sql documentation [2]:

> DB is a database handle representing a pool of zero or more underlying connections. It's safe for concurrent use by multiple goroutines.

[1]: https://stigsen.dev/notes/go-database-thread-safety/ [2]: https://pkg.go.dev/database/sql@go1.23.3#DB

discuss

order

No comments yet.