Skip to content

Commit

Permalink
Add resize statement cache fn
Browse files Browse the repository at this point in the history
  • Loading branch information
wyhaya committed Oct 16, 2024
1 parent 105b95c commit 0a0521b
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,11 @@ impl Connection {
Ok(stmt)
}

pub fn resize_statement_cache(&mut self, capacity: usize) {
assert_ne!(capacity, 0);
self.cache.resize(NonZeroUsize::new(capacity).unwrap());
}

pub fn clear_statement_cache(&mut self) {
self.cache.clear();
}
Expand Down

0 comments on commit 0a0521b

Please sign in to comment.