nostrdb

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

commit eb7520086517aaedd2338151b39913ec52fbca53
parent dba3acafc957766a7fe4dfcbc1b22a1eb661de43
Author: William Casarin <jb55@jb55.com>
Date:   Mon, 30 Dec 2024 10:38:23 -0800

ndb: add since and until

Diffstat:
Mndb.c | 12+++++++++++-
1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/ndb.c b/ndb.c @@ -252,7 +252,17 @@ int main(int argc, char *argv[]) ndb_filter_end_field(f); argv += 2; argc -= 2; - } else if (!strcmp(argv[0], "-u")) { + } else if (!strcmp(argv[0], "--since") || !strcmp(argv[0], "-s")) { + if (current_field) { + ndb_filter_end_field(f); + current_field = 0; + } + ndb_filter_start_field(f, NDB_FILTER_SINCE); + ndb_filter_add_int_element(f, atoll(argv[1])); + ndb_filter_end_field(f); + argv += 2; + argc -= 2; + } else if (!strcmp(argv[0], "--until") || !strcmp(argv[0], "-u")) { if (current_field) { ndb_filter_end_field(f); current_field = 0;