From 0a0521bbfa220262050e8de1f8d3d2bf0c7790ae Mon Sep 17 00:00:00 2001 From: wyhaya Date: Wed, 16 Oct 2024 10:39:00 +0800 Subject: [PATCH] Add resize statement cache fn --- src/lib.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/lib.rs b/src/lib.rs index e8972d5..4e06ff1 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -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(); }