nostrdb

an unfairly fast embedded nostr database backed by lmdb
git clone git://jb55.com/nostrdb
Log | Files | Refs | Submodules | README | LICENSE

commit 5ca205acead7a70cd3c7fcf6ff5054d1e97c526d
parent 77e6bce76f4f9085b456bd5d443328a753ceee7b
Author: William Casarin <jb55@jb55.com>
Date:   Fri,  1 Dec 2023 17:19:38 -0800

util/ndb: return note ids

Diffstat:
Mndb.c | 10++++++++++
1 file changed, 10 insertions(+), 0 deletions(-)

diff --git a/ndb.c b/ndb.c @@ -95,6 +95,13 @@ static void ndb_print_text_search_key(struct ndb_text_search_key *key) key->note_id); } +static void print_hex(unsigned char* data, size_t size) { + size_t i; + for (i = 0; i < size; i++) { + printf("%02x", data[i]); + } +} + static void ndb_print_text_search_result(struct ndb_txn *txn, struct ndb_text_search_result *r) { @@ -108,6 +115,9 @@ static void ndb_print_text_search_result(struct ndb_txn *txn, return; } + printf(" "); + print_hex(note->id, 32); + printf("\n%s\n\n---\n", ndb_note_str(note, &note->content).str); }