Add RocksDB.Lite: Simple document DB on top of RocksDB KV-store - #75
Open
theolivenbaum wants to merge 3 commits into
Open
Add RocksDB.Lite: Simple document DB on top of RocksDB KV-store#75theolivenbaum wants to merge 3 commits into
theolivenbaum wants to merge 3 commits into
Conversation
Introduces a small embedded document database layer on top of RocksDB. Each collection and each index lives in its own column family so sorted iteration uses the native iterator without keyspace filtering. Scalar ids and index values are encoded order-preservingly (sign-flipped big-endian for numerics, NUL-terminated UTF-8 for strings, etc.) which makes index keys a plain concat of [encoded(value), encoded(id)] and keeps RocksDB's default comparator matching natural order. Adds matching MSTest project (Tests/LiteTest) and a CLAUDE.md in lite/ documenting the storage model, key encoding and intentional non-goals.
Adds four new test files (55 new tests, 77 total): - LiteKeyTests: direct property tests on the order-preserving key encoder, covering negative numbers, doubles (incl. infinities), string lexicographic order, DateTime chronology, tag ordering across types, prefix-distinctness for strings, NUL rejection, and the unsupported-type fallback. - LiteIndexTests: more index scenarios — string range scans, DateTime ranges, double ordering with negatives/zero, Guid exact lookups, multiple indexes on one collection, null selector values being skipped, inclusive bounds, duplicate-value iteration order, EnsureIndex idempotency, and drop/recreate. - LiteCollectionEdgeTests: string ids, int auto-increment surviving reopen, nested object round-trip, empty-collection no-ops, GetCollection identity, invalid name validation, 1000-doc bulk test, DeleteAll keeping the counter, DropCollection resetting it, large-document round-trip, and cross-collection id independence. - LiteLifecycleTests: directory creation, read-only mode (read/reject create/reject drop), idempotent Dispose, persistence across open/close, custom serializer hook, ConfigureColumnFamily invocation (built via reflection to keep the test project free of a direct RocksDbSharp reference — its PackageId would otherwise shadow the runtime NuGet), CreateIfMissing=false failing on missing, and reopen-after-drop semantics.
Replaces ProjectReference to csharp/RocksDbSharp.csproj with a PackageReference to the RocksDB NuGet package in both the lite project and its test project, per the convention for new projects in this repo. This also lets the two tests that needed RocksDbSharp.ColumnFamilyOptions and RocksDbException drop their Expression/reflection workarounds — those types are now visible through the transitive package reference.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Introduces a small embedded document database layer on top of RocksDB.
Each collection and each index lives in its own column family so sorted
iteration uses the native iterator without keyspace filtering. Scalar
ids and index values are encoded order-preservingly (sign-flipped
big-endian for numerics, NUL-terminated UTF-8 for strings, etc.) which
makes index keys a plain concat of [encoded(value), encoded(id)] and
keeps RocksDB's default comparator matching natural order.
Adds matching MSTest project (Tests/LiteTest) and a CLAUDE.md in lite/
documenting the storage model, key encoding and intentional non-goals.