NuDB icon indicating copy to clipboard operation
NuDB copied to clipboard

Add Read only Mode, does not allow inserts

Open movitto opened this issue 6 years ago • 5 comments

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.

movitto avatar Jun 19 '19 19:06 movitto

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.

vinniefalco avatar Jun 19 '19 20:06 vinniefalco

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

movitto avatar Jun 20 '19 20:06 movitto

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

vinniefalco avatar Jun 20 '19 20:06 vinniefalco

@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.

movitto avatar Jun 25 '19 21:06 movitto

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

vinniefalco avatar Jun 26 '19 23:06 vinniefalco