Skip to content
Snippets Groups Projects
Commit 0d3a5278 authored by Bruno Burke's avatar Bruno Burke :hamburger:
Browse files

add reset-cache function

parent 80da0850
No related branches found
No related tags found
1 merge request!1Draft: Migration
Pipeline #95208 passed
......@@ -11,3 +11,13 @@ VALUES (:repository-name, :document-id, :version, :data)
SELECT * FROM :i:cache-table WHERE "repository" = :repository-name
AND "document" = :document-id
AND "version" = :version
-- :name reset-document-cache!
-- :command :execute
-- :result :raw
-- :doc creates a new repository table
DELETE FROM :i:cache-table;
--;;
VACUUM (VERBOSE) :i:cache-table;
--;;
REINDEX TABLE :i:cache-table;
......@@ -26,6 +26,7 @@
(create-repository [this repository] "Create a new repository")
(update-repository [this repository] "Update repository settings")
(delete-repository [this repository] "Delete a repository")
(reset-cache [this] "Clear and reset the document cache")
(cached-repository? [this repository] "Checks if the repository will use caching")
(run-query [this query-key params] "Run a Query on a DB-based Storage"))
......@@ -74,6 +75,8 @@
:uuid (get-unique-id "ds")}]
(conman/query (:queries this) query-key
(merge table-names params))))
(reset-cache [this]
(.run-query this :reset-document-cache! {}))
(cached-repository? [this repository]
(let [repo-info (run-query this :get-repository-info
{:repository repository})]
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment