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

Merged
merged 12 commits into from
Sep 26, 2024
Merged

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
@ajnavarro ajnavarro marked this pull request as ready for review September 19, 2024 11:52
@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.

@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! :)

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>
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 <antnavper@gmail.com>
@ajnavarro ajnavarro merged commit 4de2884 into main Sep 26, 2024
4 checks passed
@ajnavarro ajnavarro deleted the feature/add-generic-filters branch September 26, 2024 09:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

Successfully merging this pull request may close these issues.

2 participants