cppalliance / NuDB

NuDB: A fast key/value insert-only database for SSD drives in C++11
Boost Software License 1.0
384 stars 59 forks source link

Add Read only Mode, does not allow inserts #75

Open movitto opened 5 years ago

movitto commented 5 years ago

This would be useful for situations in which the database filesystem / files are not writeable by the local process but read functionality is desired. Mirrors the existing open API with the omission of the 'log path' parameter as this will not be created / written to anyways.

The synchronized write mechanism is skipped when the database is open in read only and attempting to call insert results in failure.

Based on PR #74, will rebase if/when that gets merged.

vinniefalco commented 5 years ago

This will need tests and coverage (i.e. 100% coverage for all new and changed lines). We should make the indicated changes first, then write the tests.

movitto commented 5 years ago

@vinniefalco sounds good, I'll get back to this & incorporate your feedback in the near future

vinniefalco commented 5 years ago

I believe @miguelportilla is working on adding nudb::string_view

movitto commented 5 years ago

@vinniefalco this was rebased ontop of the updated PR #74 and updated to incorporate feedback. Tests have not been written for this yet, I wanted to make sure this is what you were describing in your feedback. Specifically the 'open_mode' enum which was added to basic_store and specified as a param to 'open'. Is this what you were referring to regarding non-duplicate method signatures? This would cause an API incompatability and in the case of readonly access the log file param is unused.

vinniefalco commented 5 years ago

in the case of readonly access the log file param is unused.

You still need the log file in order to know if the database is in a valid state