fastogt / fastonosql

FastoNoSQL is a crossplatform Redis, Memcached, SSDB, LevelDB, RocksDB, UnQLite, LMDB, ForestDB, Pika, Dynomite, KeyDB GUI management tool.
https://fastonosql.com
GNU General Public License v3.0
1.18k stars 97 forks source link

Sub-databases contained in the primary database LMDB #30

Closed topilski closed 6 years ago

topilski commented 7 years ago

You use the mdb_dbi_open() function to open a database inside an environment. It is documented here: http://www.lmdb.tech/doc/group__internal.html#gac08cad5b096925642ca359a6d6f0562a To be a bit more clear, named databases are stored as keys in the un-named database. To get a list of the named databases, just retrieve all the keys in the un-named database, you can then open the named databases by using the key value as the name parameter to the mdb_dbi_open function. Please note that you must call mdb_env_set_maxdbs() before opening the environment to be able to open sub-databases. In my use case I set the max number to 1024.