How do you delete and rename tables from MapDB 3.x?

719 Views Asked by At

In MapDB 1.x, you could easily delete tables from the MapDB by calling db.delete("table name") and db.rename("old table name", "new table name"). But there seems to be no API functionality to do either of the above anymore.

How do you delete and rename tables in MapDB 3.x?

1

There are 1 best solutions below

1
On BEST ANSWER

In comments of Db.delete() from version 1.0, there is the following:

/** delete record/collection with given name*/.

So delete() was actually deleting named records/collections. Of course latter can be perceived as tables.

One major change in the project (since version 1.0) was the conversion to kotlin.

After this, a big refactoring seems to have happened on April 2018. See entry: Commits on Apr 5, 2018 from https://github.com/jankotek/mapdb/commits/master/src/main/java/org/mapdb/DB.kt

In this day delete() was removed from Db.tk and a Store containing put/update/delete was created.

db.getStore().delete() might be what you want to use.