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

passing array of filters to QueryEvents #30

Open
barkyq opened this issue Jan 20, 2023 · 2 comments
Open

passing array of filters to QueryEvents #30

barkyq opened this issue Jan 20, 2023 · 2 comments

Comments

@barkyq
Copy link
Contributor

barkyq commented Jan 20, 2023

Was thinking about this lately:

QueryEvents(filter *nostr.Filter) (events []nostr.Event, err error)

could be changed to:

QueryEvents(filters ...nostr.Filter) (events []nostr.Event, err error)

or:

QueryEvents(filters []nostr.Filter) (events []nostr.Event, err error)

so as to enable queries with a single call to SQL (using UNION)... but this would probably break other implementations using the relayer framework.

The current implementation potentially sends duplicate events back to the user (although this could be solved quickly via a deduplication step prior to writing to the websocket). Perhaps the above change would be a more principled solution.

@fiatjaf
Copy link
Owner

fiatjaf commented Jan 21, 2023

We should add a new interface for QueryEventsMultiple and use that if available, otherwise use QueryEvents multiple times.

@barkyq
Copy link
Contributor Author

barkyq commented Jan 22, 2023

good idea

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

No branches or pull requests

2 participants