docs: document embedding workflow - #90
Conversation
- Fix Creating Events example: ndb_process_event expects JSON, not a binary note. Use ndb_note_json to convert the built note to JSON before ingestion. - Remove unused filter_buf variable in Minimal C Example - Remove unused buf variable in Structured Queries section - Restore blank line between paragraphs in introduction Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> Signed-off-by: alltheseas <alltheseas@users.noreply.github.com>
📝 WalkthroughWalkthroughExpanded the repository README with detailed getting-started instructions, a minimal C example, configuration reference, ingestion and query workflows, fulltext search setup, data-reading and event-creation examples, subscriptions, language bindings/codegen notes, CLI usage, and development/testing guidance. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. 🧹 Recent nitpick comments
📜 Recent review detailsConfiguration used: defaults Review profile: CHILL Plan: Pro 📒 Files selected for processing (1)
🧰 Additional context used🪛 LanguageToolREADME.md[grammar] ~249-~249: Use a hyphen to join words. (QB_NEW_EN_HYPHEN) 🪛 markdownlint-cli2 (0.18.1)README.md23-23: Fenced code blocks should have a language specified (MD040, fenced-code-language) 34-34: Fenced code blocks should have a language specified (MD040, fenced-code-language) 43-43: Fenced code blocks should have a language specified (MD040, fenced-code-language) 🔇 Additional comments (1)
✏️ Tip: You can disable this entire section by setting Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Fix all issues with AI agents
In `@README.md`:
- Around line 68-73: The example ldjson string uses placeholder values ("...")
for id, pubkey, and sig which will cause ndb_process_events(db, ldjson,
strlen(ldjson)) to fail; update the const char *ldjson used in the example to
either (a) contain valid test nostr event fields (id and pubkey as 32-byte hex,
sig as 64-byte hex) or (b) add a clear comment immediately above the ldjson
declaration explaining that id/pubkey must be 32-byte hex and sig must be
64-byte hex and that placeholders must be replaced with valid cryptographic
values for ndb_process_events to succeed. Ensure the note references the ldjson
variable and the ndb_process_events call so readers know why the change is
required.
🧹 Nitpick comments (3)
README.md (3)
23-27: Add language specifiers to code blocks for syntax highlighting.The code blocks lack language identifiers, which prevents proper syntax highlighting and violates markdown best practices.
📝 Proposed fix
-``` +```bash git clone https://github.com/damus-io/nostrdb.git cd nostrdb git submodule update --init --recursive make lib ndb```diff -``` +```bash cc app.c libnostrdb.a \ -Isrc -Ideps/lmdb -Ideps/secp256k1/include \ deps/lmdb/liblmdb.a deps/secp256k1/.libs/libsecp256k1.a \ -lpthread -lzstd```diff -``` +```bash mkdir -p /var/lib/nostrdb</details> Also applies to: 34-39, 44-46 --- `226-226`: **Clarify placeholder nsec key or provide test data.** The example uses `"nsec1..."` as a placeholder for `ndb_decode_key`, which won't work in practice. Consider adding a comment noting this is a placeholder, or provide a valid test nsec key for users to try the example. <details> <summary>📝 Suggested clarification</summary> ```diff struct ndb_keypair keypair; -ndb_decode_key("nsec1...", &keypair); +// Replace with your actual nsec key +ndb_decode_key("nsec1...", &keypair);
249-249: Fix hyphenation of compound modifier.The phrase "higher level" should be hyphenated as "higher-level" when used as a compound adjective modifying "bindings."
📝 Proposed fix
-`make bindings` regenerates higher level bindings using `flatc` and `flatcc`: +`make bindings` regenerates higher-level bindings using `flatc` and `flatcc`:
📜 Review details
Configuration used: defaults
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
README.md
🧰 Additional context used
🪛 LanguageTool
README.md
[grammar] ~249-~249: Use a hyphen to join words.
Context: ...ings make bindings regenerates higher level bindings using flatc and `flatcc...
(QB_NEW_EN_HYPHEN)
🪛 markdownlint-cli2 (0.18.1)
README.md
23-23: Fenced code blocks should have a language specified
(MD040, fenced-code-language)
34-34: Fenced code blocks should have a language specified
(MD040, fenced-code-language)
44-44: Fenced code blocks should have a language specified
(MD040, fenced-code-language)
🔇 Additional comments (7)
README.md (7)
108-121: Excellent configuration documentation.This section provides comprehensive coverage of all major configuration options with clear descriptions of their purposes. Well-organized and helpful for users.
122-133: Clear and comprehensive ingestion documentation.The section effectively explains the different ingestion functions, their use cases, and important considerations like verification bypass and ingest filters.
135-159: Well-structured query documentation with clear examples.The explanation of the transaction model and filter construction is clear, and the code example effectively demonstrates the API. The note about result validity is an important detail.
161-167: Concise and informative fulltext search documentation.The section covers the essential aspects of fulltext search including configuration and the ability to combine with structured queries.
169-204: Comprehensive data access documentation with practical examples.The section provides a thorough list of accessor functions and includes a complete, working code example that demonstrates block iteration and proper memory management. The optimization tip about
NDB_FLAG_NO_NOTE_BLOCKSis valuable.
240-245: Clear subscription mechanism overview.The section concisely explains the subscription model and the two notification delivery approaches, providing enough information for users to understand the feature.
301-304: Good development guidance.The section provides essential information for contributors, including test execution and the rationale for vendored dependencies.
✏️ Tip: You can disable this entire section by setting review_details to false in your review settings.
Clarify that the "..." placeholders in the JSON example must be replaced with valid hex-encoded cryptographic values (32-byte id/pubkey, 64-byte sig). Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> Signed-off-by: alltheseas <alltheseas@users.noreply.github.com>
Summary
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.