timshannon / badgerhold

BadgerHold is an embeddable NoSQL store for querying Go types built on Badger
MIT License
514 stars 52 forks source link

Created a method Query.Match that returns whether a query matches a data item. #107

Closed zond closed 5 months ago

zond commented 5 months ago

I am working on a library that will provide subscription semantics to a badgerhold storage.

The subscriptions will be defined as "whatever matches a badgerhold Query".

To know if a subscriber should be updated when an insert/delete/update happens, I need to check if the item matches a Query.

The simplest way I could figure out of doing that is this PR.

What do you think, is this an acceptable solution? I'd be happy to discuss and modify my PR until you're happy with it.

zond commented 5 months ago

Sorry, my git expertise is lacking. It did point to your main branch when I created the PR, but since then I updated things to make it work locally.

Does it look better now?

timshannon commented 5 months ago

Looks great. Thanks for the PR.