Closed undr closed 2 years ago
Hello @undr , if you want to clear the database completely, you can remove or rename the data directory, as you mentioned. This needs to be done while CubDB is not running though, so you should probably stop the CubDB process, clear the data directory, then start it again.
Your question makes me realize that I should probably add a way to clear the database without needing to stop the process (that would be quite simple, I think I can add it in the next release).
Thank you for your reply.
It would be awesome to have the ability to remove all records without a server halt. It will allow me to put the database process under the supervisor's control. Because, currently, I have to use a dynamic supervisor to stop/start a server to delete a database. It's not handy to use.
I am looking forward to the new feature. =)
Hi @undr, #43 implements a new clear/1
function that atomically and efficiently deletes all entries in the database. I just need some more time to make sure everything is ok, then soon I will make a new release including it.
Version v1.1.0
is released, and includes this feature. Closing the issue now, but feel free to comment further if necessary.
Hey there.
I'm going to use
cubdb
to store temporary logs in my app. My app has to reset the database from time to time by user request. I didn't find a way how to reset the database. Should I remove (or rename) database dir, or is there a more native way to achieve this in one operation?