polarsignals / frostdb

❄️ Coolest database around 🧊 Embeddable column database written in Go.
Apache License 2.0
1.27k stars 65 forks source link

*: future-proof DropDB #903

Closed asubiotto closed 1 month ago

asubiotto commented 1 month ago

When adding an index directory, we didn't account for it in DropDB, causing os.Remove to error with "directory is not empty". This commit simply iterates over all directory entries in the storage path and renames them, rather than only renaming a pre-specified subset. Additionally, Remove has been changed to RemoveAll in DropDB, which handles directories with elements still in them.