Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Implement generic filters #90

Open
wants to merge 11 commits into
base: main
Choose a base branch
from

Conversation

ajnavarro
Copy link
Collaborator

@ajnavarro ajnavarro commented Sep 10, 2024

I added a new query API to implement the first version of generic filters. The previous API is still working, I added this as an EXPERIMENTAL preview to gather feedback.

New features:

  • New subscription and query methods implemented using the new Filter objects
  • Filter using AND and OR and NOT filters. Implemented expressions: ==,!=, <, >, EXISTS, LIKE (using regular expressions).
  • You can filter using 99% of existing fields.
  • Added default examples showing how the filter API works. more examples will be added.

Please, any feedback is welcome!

Simple example query:

https://github.com/gnolang/tx-indexer/pull/90/files#diff-ab80be59ac3c22370754caec134ff00ed78559b8aefc392f485b730db636b44aR1-R14

@ajnavarro ajnavarro requested a review from a team as a code owner September 10, 2024 18:42
@ajnavarro ajnavarro marked this pull request as draft September 10, 2024 18:46
@ajnavarro ajnavarro changed the title feature: Implement generic filters feat: Implement generic filters Sep 11, 2024
Added new query API implementing a first version of generic filters.

Some things are missing:

- No subscriptions yet, almost there
- No filters for multi type fields like messages, still thinking about
  how to implement the API to make it user friendly.

Please, any feedback is welcome!

Signed-off-by: Antonio Navarro Perez <antnavper@gmail.com>
Signed-off-by: Antonio Navarro Perez <antnavper@gmail.com>
Signed-off-by: Antonio Navarro Perez <antnavper@gmail.com>
Signed-off-by: Antonio Navarro Perez <antnavper@gmail.com>
Signed-off-by: Antonio Navarro Perez <antnavper@gmail.com>
Signed-off-by: Antonio Navarro Perez <antnavper@gmail.com>
Signed-off-by: Antonio Navarro Perez <antnavper@gmail.com>
Signed-off-by: Antonio Navarro Perez <antnavper@gmail.com>
@ajnavarro ajnavarro marked this pull request as ready for review September 19, 2024 11:52
Signed-off-by: Antonio Navarro Perez <antnavper@gmail.com>
Signed-off-by: Antonio Navarro Perez <antnavper@gmail.com>
@thehowl
Copy link
Member

thehowl commented Sep 20, 2024

i skimmed through the pr and i like the idea per-se; but i feel i'd need to play around with it to get a feeling and if it does what i need.

can you or @sw360cab set up a quick server for checking this out? can be a 3$/mo machine to just try it out that we kill after a week.

Signed-off-by: Antonio Navarro Perez <antnavper@gmail.com>
@ajnavarro
Copy link
Collaborator Author

@thehowl do not hesitate to ask me anything/point out any strange API behavior you consider. We can sync to discuss your use cases when you have time.

@thehowl
Copy link
Member

thehowl commented Sep 20, 2024

gladly, but i still haven't played with it so i don't have feedback yet! :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Triage
Development

Successfully merging this pull request may close these issues.

2 participants