Oddbean new post about | logout
 New features coming to #nostrdb soon:

1. Indexable cursor api

This will allow you to perform resumable and paginated queries in realtime. This will enable infinite scroll on arbitrary queries, you will also be able to index/seek into these queries at any point, which will be useful for building performant infinite timeline renderers: “render notes 5..8 in this cursor query”

These cursors will maintain a consistent view of the data within a transaction.

1. Arbitrary query filters

Query the database with an arbitrary filter function that filters results based on any logic you want. When you combine this with the cursor api, you can have infinitely scrollable queries with arbitrary complexity.

In the future, nostrscripts will also be able to be able to run inside of a query filter, enabling custom, scriptable, sharable,  infinitely scrollable queries of any kind. 
 Cool features! 🤘 
 Is nostrdb used in any relay software yet? 
 I use it for the damus.io shortlink renderer. I thought about building a custom relay using it. One day if i get time 
 lol I wonder how good go's c interop is 
 nostrdb has an ergonomic rust api if anyone wants to try it out! I still need to improve the docs though 😬 
 I'm going to give it a shot soon. I'm building a rust library that uses the actors pattern for connecting to database and relays. 
 What's the most idiomatic way of using nostrdb? Call it on every frame render? Surely that would be better than copying the events to a different memory location. 
 Repaint. 
 DBってどこに置くんだ?
nostr:nevent1qqs22fuuj3h3wdmnaeyk7a36mjnr02t8c8namwk3mglv8tm7kuqdh9qpp4mhxue69uhkummn9ekx7mqzyqewrqnkx4zsaweutf739s0cu7et29zrntqs5elw70vlm8zudr3y2qcyqqqqqqgaj9h4v 
 Give me all notes with IDs divisible by 17 and 371 from my follows, my follows' follows, and my follows' follows' blocked npubs, and reject any note containing "/what(\?|¿)/gi" 
 I don’t think they would be useful across the network, as the underlying data would be changing as you traverse. Unindexable resumable cursors might be doable though