pub trait StatementCacheStrategy<DB, Statement>: Send + 'static{
// Required methods
fn cache_size(&self) -> CacheSize;
fn lookup_statement(
&mut self,
key: StatementCacheKey<DB>,
) -> LookupStatementResult<'_, DB, Statement>;
}
Available on crate feature
i-implement-a-third-party-backend-and-opt-into-breaking-changes
only.Expand description
Implement this trait, in order to control statement caching.
Required Methods§
Sourcefn cache_size(&self) -> CacheSize
fn cache_size(&self) -> CacheSize
Returns which prepared statement cache size is implemented by this trait
Sourcefn lookup_statement(
&mut self,
key: StatementCacheKey<DB>,
) -> LookupStatementResult<'_, DB, Statement>
fn lookup_statement( &mut self, key: StatementCacheKey<DB>, ) -> LookupStatementResult<'_, DB, Statement>
Returns whether or not the corresponding cache key is already cached