ccorcos / tuple-database

406 stars 19 forks source link

Adds an `iterate` method that returns a (Async)Generator #29

Open theSherwood opened 7 months ago

theSherwood commented 7 months ago

I don't know if you have a use for this, but there have been a few occasions using this library when I've wanted an iterate instead of a scan. So this adds PR adds an iterate method both to sync and async clients and store wrappers. I've also added a handful of tests (that are basically just copies of the scan tests). I have not done any checks with respect to reactivity and iterate, however.

Thoughts?

ccorcos commented 7 months ago

This is cool! Particulatly for reducing memory pressure when computing over a lot of data.

That said, I am in the process of refactoring / rewriting this whole library so I don't exactly want to spend my time right now reviewing this PR and getting it merged... Let me return to this in a few weeks.

theSherwood commented 7 months ago

No problem! I saw you have the bptree branch. I had thought to make a feature request for an iterate method but figured it wouldn't take long to add it myself. I'm happy to wait for the new version of tuple-database. I'm looking forward to the interval trees!

ccorcos commented 7 months ago

Poke around over here if you're interested 😄 https://github.com/ccorcos/database-experiments