relayer
relayer copied to clipboard
passing array of filters to QueryEvents
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.
We should add a new interface for QueryEventsMultiple
and use that if available, otherwise use QueryEvents
multiple times.
good idea