diff options
Diffstat (limited to 'cli/cache/code_cache.rs')
-rw-r--r-- | cli/cache/code_cache.rs | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/cli/cache/code_cache.rs b/cli/cache/code_cache.rs index abcd0d46a..d9e951af6 100644 --- a/cli/cache/code_cache.rs +++ b/cli/cache/code_cache.rs @@ -80,6 +80,10 @@ impl CodeCache { data, )); } + + pub fn remove_code_cache(&self, specifier: &str) { + Self::ensure_ok(self.inner.remove_code_cache(specifier)) + } } impl code_cache::CodeCache for CodeCache { @@ -158,6 +162,15 @@ impl CodeCacheInner { self.conn.execute(sql, params)?; Ok(()) } + + pub fn remove_code_cache(&self, specifier: &str) -> Result<(), AnyError> { + let sql = " + DELETE FROM codecache + WHERE specifier=$1;"; + let params = params![specifier]; + self.conn.execute(sql, params)?; + Ok(()) + } } fn serialize_code_cache_type( |