Skip to content

feat: add prepared stmt caching - #9

Merged
rfberaldo merged 8 commits into
mainfrom
feat/stmt
Oct 18, 2025
Merged

rfberaldo merged 8 commits into
mainfrom
feat/stmt

Conversation

@rfberaldo

@rfberaldo rfberaldo commented Oct 18, 2025

Copy link
Copy Markdown
Owner

This adds automatic prepared statement caching, using LRU policy, and a conservative default capacity of 16, effectively per connection.

Can be disabled by setting capacity to zero:

db := sqlz.New(driverName, pool, &sqlz.Options{
  StatementCacheCapacity: 0,
})

Inspired by https://github.com/CAFxX/autoprepare + https://github.com/jackc/pgx

@rfberaldo
rfberaldo merged commit 2fabe40 into main Oct 18, 2025
2 checks passed
@rfberaldo
rfberaldo deleted the feat/stmt branch October 18, 2025 15:51
Repository owner deleted a comment from codecov-commenter Oct 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant