Skip to content

docs(readme): show only APIs that exist in the source - #298

Merged
mrdevrobot merged 2 commits into
EntglDb:mainfrom
CaffeinatedCoder:docs/readme-real-apis
Oct 20, 2026
Merged

mrdevrobot merged 2 commits into
EntglDb:mainfrom
CaffeinatedCoder:docs/readme-real-apis

Conversation

@CaffeinatedCoder

@CaffeinatedCoder CaffeinatedCoder commented Oct 17, 2026 •

Copy link
Copy Markdown
Collaborator

Part of #296 (section 8, "wrong today"). Docs only, README.md only.

The README showed APIs that BLite does not have, so a sample copied from it did not compile, and nuget.org shows the same README for every package. Each corrected sample was compiled and run against src/ at 0450b97 in a scratch console app (not committed): 12 checks, all pass.

Section Was Now Evidence
Custom ID converters collection.FindById(...) await collection.FindByIdAsync(...) v4 removed sync CRUD
Encryption: master key, multi-process new AppDb(...) new AppDbContext(...) the generator only handles a class whose name ends in Context (BLiteConventions.DbContextClassSuffix); the encryption sample declares AppDbContext
Encryption: migration and key rotation MigrateToEncryptedAsync, MigrateToPlaintextAsync, RotateEncryptionKeyAsync, KeyRotationOptions one sentence saying there is no such API yet no match in src/
Secure erase HasSecureErase(true), db.VacuumAsync() on a context what the code does: a delete zero-fills its bytes on the page (DocumentCollection.DeleteCore → CompactPage + Clear, DynamicCollection.DeleteSlot → SlottedPageUtils.CompactAndErase); the file gets the zeroed page at the next checkpoint; VacuumAsync(new VacuumOptions { SecureErase = true }) on the engine or a collection, then CheckpointAsync HasSecureErase has no match; DocumentDbContext has no VacuumAsync. Checked at run time: a marker string is gone from the typed .db after delete and dispose; on a BLiteEngine it stays in .db until CheckpointAsync
TimeSeries engine.Commit() await engine.CommitAsync() BLiteEngine has CommitAsync only
Schema-less read d.GetString("status") d.TryGetString("status", out var s) && s == "pending" BsonDocument has no GetString
Zero-copy scan orders.Scan(...) with reader.TryReadString(...) ScanAsync with the element loop the tests use no Scan on DynamicCollection, no TryReadString on BsonSpanReader
Index management CreateIndex, CreateVectorIndex, CreateSpatialIndex the *Async forms DynamicCollection has async index creation only
Reading fields FindById, doc.GetString, doc.GetDouble, doc.Id FindByIdAsync, GetValue(...).AsString/AsDouble, TryGetId, TryGetString BsonDocument API
Sessions col.Insert(eventDoc) await col.InsertAsync(eventDoc, ct) v4
Multi-file migration BLiteMigration.ToMultiFile( / ToSingleFile( await ...ToMultiFileAsync( / ToSingleFileAsync( only the async forms exist
Roadmap list "offline migration helpers, and online key rotation"; HasSecureErase(true); ToMultiFile() removed / corrected to match the above as above
Documentation links RFC.md, C-BSON.md (relative) absolute GitHub links relative links break in the packed README on nuget.org

Not changed here (separate items in #296): the README structure, the outdated version banners, the duplicated BLQL section, and RFC.md / C-BSON.md themselves.

Found while checking, not fixed here:

  • GdprStrictValidator warns at run time that "Deleted document slots are not currently zeroed at the page layer", but both delete paths zero them (checked at run time above). The warning, and its pointer to MISSING_FEATURES.md §3, look out of date.
  • A DocumentDbContext subclass whose name does not end in Context gets no generated code and no diagnostic; its collection properties stay null and the first call throws a NullReferenceException.

Line endings stay CRLF; the diff touches only the changed lines.

Conflicts with other open PRs

Conflicts with #310 (write-write conflict detection) in README.md, in the roadmap list. Resolution: #310's BLiteSession line (the first committer wins) and this PR's migration line (ToMultiFileAsync / ToSingleFileAsync). Either PR can land first; I will push the resolution to the second.

🤖 Generated with Claude Code

Samples in the README called methods that BLite does not have, so copying
them failed to compile, and nuget.org shows the same README for every
package. Each corrected sample was compiled and run against src/.

- Encryption: MigrateToEncryptedAsync, MigrateToPlaintextAsync,
  RotateEncryptionKeyAsync and KeyRotationOptions do not exist; say so
  instead of showing them, and drop the matching roadmap claim.
- Secure erase: HasSecureErase does not exist and DocumentDbContext has no
  VacuumAsync. Describe what the code does: a delete zero-fills the bytes
  on its page, the file gets them at the next checkpoint, and VacuumAsync
  with VacuumOptions.SecureErase zero-fills all free space.
- Sync calls removed in v4 or never present: FindById, Insert,
  engine.Commit, CreateIndex/CreateVectorIndex/CreateSpatialIndex on
  DynamicCollection, Scan, BLiteMigration.ToMultiFile/ToSingleFile.
- BsonDocument has no GetString, GetDouble or Id; use GetValue(...).As*,
  TryGetString and TryGetId. BsonSpanReader has no TryReadString.
- AppDb -> AppDbContext: the generator only handles a context whose name
  ends in "Context", and the encryption sample declares AppDbContext.
- RFC.md and C-BSON.md links are absolute, since relative links break in
  the packed README on nuget.org.

Refs EntglDb#296

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@CaffeinatedCoder

Copy link
Copy Markdown
Collaborator Author

The two findings listed under "Found while checking" are now issues:

Both are also listed in #296 section 8.

@mrdevrobot mrdevrobot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes requested. Every changed line checks out against the source. But the same Read block (README ~801–808) still shows orders.QueryIndex(...), VectorSearch(...), Near(...) and Within(...), which do not exist: DynamicCollection only has the *Async forms returning IAsyncEnumerable<BsonDocument>. Fix those four lines with await foreach and this can go in.

…*Async streams

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@CaffeinatedCoder

Copy link
Copy Markdown
Collaborator Author

Done in f38f1e0: the four lines now use await foreach over QueryIndexAsync, VectorSearchAsync, NearAsync and WithinAsync with the parameter names from DynamicCollection.cs:1041–1142, and a scratch project compiles them against BLite.Core.

@mrdevrobot
mrdevrobot merged commit aa8dbb5 into EntglDb:main Oct 20, 2026
2 checks passed

This branch was successfully deployed

1 active deployment
Production — f38f1e0d Deployed Oct 19, 2026 by CaffeinatedCoder via build_and_publish #798
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants