From 2a97f2f21840304e3d26a9d6957b780906998320 Mon Sep 17 00:00:00 2001 From: kimory Date: Fri, 21 Oct 2022 22:54:03 +0200 Subject: [PATCH] Add a drop DB function --- src/main.lisp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/main.lisp b/src/main.lisp index a89a6ae..fcd262c 100644 --- a/src/main.lisp +++ b/src/main.lisp @@ -10,7 +10,8 @@ :db/del ; del a value from the DB :db/get-by-index ; :db/get-by-partition ; - :db-data ; + :db/drop-everything ; + :db-data ; )) (in-package dodb) @@ -278,3 +279,7 @@ (maphash #'(lambda (partition-name fsymbol) (db/partition/update dbpath partition-name fsymbol object file-basename old-object)) (db-partitions database)))) + +(defun db/drop-everything (database) + (osicat:delete-directory-and-files (db-path database)) + (clrhash (db-data database)))