document that _stmt_cache_size is per connection

Clarify that each connection in the sql.DB pool maintains its own
independent statement cache.
This commit is contained in:
Yasuhiro Matsumoto
2026-04-08 13:43:47 +09:00
parent 867dcbfbdc
commit e302e5cb8c

View File

@@ -1525,6 +1525,9 @@ func (d *SQLiteDriver) Open(dsn string) (driver.Conn, error) {
cacheSize = &iv 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 != "" { if val := params.Get("_stmt_cache_size"); val != "" {
iv, err := strconv.Atoi(val) iv, err := strconv.Atoi(val)
if err != nil { if err != nil {