nostrdb

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

commit e0be35c20d314b204d932e4093b29f0a27bda21c
parent b2b6bc65ccf010bda4bda509edcdc31518c585cd
Author: William Casarin <jb55@jb55.com>
Date:   Tue,  8 Jul 2025 14:13:11 -0700

cli: more results

Signed-off-by: William Casarin <jb55@jb55.com>

Diffstat:
Mndb.c | 7++++---
1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/ndb.c b/ndb.c @@ -362,10 +362,11 @@ int main(int argc, char *argv[]) ndb_filter_json(f, buf, sizeof(buf)); fprintf(stderr, "using filter '%s'\n", buf); - struct ndb_query_result results[10000]; + int rsize = 30000; + struct ndb_query_result *results = malloc(sizeof(struct ndb_query_result) * rsize); + assert(results); ndb_begin_query(ndb, &txn); - clock_gettime(CLOCK_MONOTONIC, &t1); if (key) { results[0].note = ndb_get_note_by_key(&txn, key, NULL); @@ -373,7 +374,7 @@ int main(int argc, char *argv[]) count = 1; else count = 0; - } else if (!ndb_query(&txn, f, 1, results, 10000, &count)) { + } else if (!ndb_query(&txn, f, 1, results, rsize, &count)) { fprintf(stderr, "query error\n"); } clock_gettime(CLOCK_MONOTONIC, &t2);