I am building a Clojure wrapper for FoundationDB. I would like to write a function to clear all the values from the database. I googled the question and came across the below answer :
It uses the Python API with ‘’ as start and ‘\xFF’ for the end in the clear_range function. The same works with get_range function also. There is a comment in the question with the equivalent Java code
When I use the same in Clojure the keys are not getting deleted. They delete only till x and when I have a key named ‘z’ its not getting deleted.
Clojure code :
(defn clear-all "Clear all keys from the database" [db] (.run db (reify java.util.function.Function (apply [this tr] (let [begin (.pack (Tuple/from (to-array [""]))) end (.pack (Tuple/from (to-array ["xFF"])))] (.clear tr (Range. begin end)))))))
The printable range is as below :