From e302e5cb8c4c737561a2ab8a86136095c676c2af Mon Sep 17 00:00:00 2001 From: Yasuhiro Matsumoto Date: Wed, 8 Apr 2026 13:43:47 +0900 Subject: [PATCH] document that _stmt_cache_size is per connection Clarify that each connection in the sql.DB pool maintains its own independent statement cache. --- sqlite3.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sqlite3.go b/sqlite3.go index db865a7..1a5433c 100644 --- a/sqlite3.go +++ b/sqlite3.go @@ -1525,6 +1525,9 @@ func (d *SQLiteDriver) Open(dsn string) (driver.Conn, error) { cacheSize = &iv } + // _stmt_cache_size sets the maximum number of prepared statements + // cached per connection. Note that sql.DB is a connection pool, so + // each connection maintains its own independent cache. if val := params.Get("_stmt_cache_size"); val != "" { iv, err := strconv.Atoi(val) if err != nil {