diff options
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/cache.fnl | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/cache.fnl b/lib/cache.fnl index 76ede13..fdde74c 100644 --- a/lib/cache.fnl +++ b/lib/cache.fnl @@ -15,11 +15,11 @@ [key value])) value) -(fn clear-tx [tx prefix] +(fn clear [db prefix] (if (= "string" (type prefix)) - (must (luna.db.exec-tx tx "DELETE FROM cache WHERE key LIKE ?" + (must (luna.db.exec db "DELETE FROM cache WHERE key LIKE ?" [(.. prefix "%")])) - (must (luna.db.exec-tx tx "DELETE FROM cache" [])))) + (must (luna.db.exec db"DELETE FROM cache" [])))) (fn wrap [db key f] (local cached (get db key)) @@ -28,4 +28,4 @@ (let [res (f)] (if res (_set db key res) nil)))) -{: get :set _set : clear-tx : wrap} +{:get get :set _set :clear clear :wrap wrap} |
