foundationdb

How to clean FoundationDB?


Is there any fast way to remove all data from the local database? Like SQL 'drop database'?

I was looking through the documentation but haven't found anythig interesting yet.


Solution

  • You can do this by clearing the entire range of keys.

    In Python, it looks like this:

    Database.clear_range('', '\xFF')
    

    Where '' is the default slice begin, and '\xFF' is the default slice end, according to the clear_range documentation.

    You can find the more information on clear_range for the API you're using in the documentation.