nostrdb

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

commit 05ed6252c0c63503ed7de83cb6296e03a02b1677
parent a2bc936c1bf6f788b95024a1e36f916484fef103
Author: William Casarin <jb55@jb55.com>
Date:   Tue, 19 Sep 2023 16:30:29 -0400

search: use proper compare function

Before it was just using the default comparator which works fine, but
we'll use a more customized one that includes timestamps

Diffstat:
Mnostrdb.c | 1+
1 file changed, 1 insertion(+), 0 deletions(-)

diff --git a/nostrdb.c b/nostrdb.c @@ -1269,6 +1269,7 @@ static int ndb_init_lmdb(const char *filename, struct ndb_lmdb *lmdb, size_t map fprintf(stderr, "mdb_dbi_open profile failed, error %d\n", rc); return 0; } + mdb_set_compare(txn, lmdb->dbs[NDB_DB_PROFILE_SEARCH], ndb_search_key_cmp); // ndb metadata (db version, etc) if ((rc = mdb_dbi_open(txn, "ndb_meta", MDB_CREATE | MDB_INTEGERKEY, &lmdb->dbs[NDB_DB_NDB_META]))) {