Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: mattn/go-sqlite3
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v1.14.41
Choose a base ref
...
head repository: mattn/go-sqlite3
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v1.14.42
Choose a head ref
  • 8 commits
  • 1 file changed
  • 1 contributor

Commits on Apr 7, 2026

  1. add opt-in statement cache

    mattn committed Apr 7, 2026
    Configuration menu
    Copy the full SHA
    efa9b1c View commit details
    Browse the repository at this point in the history

Commits on Apr 8, 2026

  1. check stmtCacheSize before acquiring mutex in takeCachedStmt

    stmtCacheSize is immutable after connection open, so checking it
    before the lock avoids mutex overhead when cache is not enabled.
    mattn committed Apr 8, 2026
    Configuration menu
    Copy the full SHA
    061c2a5 View commit details
    Browse the repository at this point in the history
  2. remove redundant stmtCacheSize check in putCachedStmt

    When stmtCacheSize <= 0, stmtCacheCount >= stmtCacheSize is always
    true, so the explicit check is unnecessary.
    mattn committed Apr 8, 2026
    Configuration menu
    Copy the full SHA
    325cb8d View commit details
    Browse the repository at this point in the history
  3. do not bail out on finalize error in closeCachedStmtsLocked

    Finalize all cached statements even if one fails. Leaving a
    finalized statement in the cache map would be a use-after-finalize
    bug per SQLite documentation.
    mattn committed Apr 8, 2026
    Configuration menu
    Copy the full SHA
    e9f47da View commit details
    Browse the repository at this point in the history
  4. simplify prepareWithCache to call prepare instead of duplicating logic

    prepareWithCache now delegates to prepare and sets cacheKey
    afterward, removing the useCache boolean parameter.
    mattn committed Apr 8, 2026
    Configuration menu
    Copy the full SHA
    0e58fa4 View commit details
    Browse the repository at this point in the history
  5. move reset/clear into putCachedStmt and always finalize on failure

    This avoids an unnecessary reset when the cache is full, guarantees
    a statement cannot enter the cache without being reset/cleared, and
    fixes a leak where sqlite3_finalize was not called when reset failed.
    mattn committed Apr 8, 2026
    Configuration menu
    Copy the full SHA
    867dcbf View commit details
    Browse the repository at this point in the history
  6. document that _stmt_cache_size is per connection

    Clarify that each connection in the sql.DB pool maintains its own
    independent statement cache.
    mattn committed Apr 8, 2026
    Configuration menu
    Copy the full SHA
    e302e5c View commit details
    Browse the repository at this point in the history
  7. Merge pull request #1387 from mattn/codex/stmt-cache

    [codex] add opt-in statement cache
    mattn authored Apr 8, 2026
    Configuration menu
    Copy the full SHA
    5df13a0 View commit details
    Browse the repository at this point in the history
Loading