[Date Prev][Date Next]
[Chronological]
[Thread]
[Top]
[LMDB] Two API questions
Hi,
during the implementation of my first project using LMDB I got two questions:
1. I wanted to write a small utility function that determines a rough
estimation of the free space, using the mdb_env_stat, mdb_env_info and
mdb_stat functions, summing up the block counts, multiplying it with the
block size and putting this in relation to the map size. Typically I know
which databases exist, but I wondered whether there would be a possibility
to enumerate the existing databases and did not find anything. Is it
correct that currently there is no way to get the names?
2. For one task, I needed to walk through a subset of the keys with a cursor
and to delete key/value pairs that meet some criteria. From the
documentation, it is unclear to me how to proceed after a deletion,
i.e. which cursor operation should be used to access the next key/value pair.
Both MDB_GET_CURRENT and MDB_NEXT seemed to work. Which one is preferred
or the "officially" correct way? I guess MDB_NEXT.
Thanks a lot.
Regards,
Klaus