Open andrewosh opened 6 years ago
This PR has been updated with support for a top-level lexint
flag. When enabled, paths will be constructed without any hashing, and iteration will thus be lexicographically ordered. When disabled, path components will be hashed (as in current master).
Storing a db's path configuration (is there a better term for this?) in a header is still in the works.
Some wires got crossed and I was referring to "lexicographic iteration" as lexint
, which is lexicographic integer! This PR will be updated to rename lexint
-> lex
This PR includes a couple of changes to make lexicographic iteration possible (relevant discussion here https://github.com/mafintosh/hyperdb/issues/78). Once supported, we should be able to create useful things like a leveldown implementation based on hyperdb.
Summary of changes:
lib/hash.js
has been modified to support variable-length paths. Each path component is separated by a separator value instead of being fixed-length.lib/iterator.js
andlib/put.js
have been lightly modified to a) remove hard-coded values and b) make non-recursive iteration respect the path separator.Some things to consider before this can be merged:
Note: This is still WIP, and the above issues need to be addressed before merging.