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

Queries with multiple e tags return no results on sqlite #47

Open
bndw opened this issue Apr 27, 2023 · 8 comments
Open

Queries with multiple e tags return no results on sqlite #47

bndw opened this issue Apr 27, 2023 · 8 comments

Comments

@bndw
Copy link
Contributor

bndw commented Apr 27, 2023

Single e tag works as expected

nostcat ws://localhost:9000
["REQ","RAND",{"kinds":[1],"#e":["8b1013c2d137bab5a7026e5adc65dcd641025c1a8ae2b7ecdec848cca44f1297"]}

Two values returns nothing:

nostcat ws://localhost:9000
["REQ","RAND",{"kinds":[1],"#e":["8b1013c2d137bab5a7026e5adc65dcd641025c1a8ae2b7ecdec848cca44f1297","e32f75bfce9513bab7c7e82b9a61fd56f80f68946a9d0a384f7f17989bd91f13"]}]

I suspect this has to do with the LIKE query generation. I will be working on a fix but if you can get it in quicker I'd gladly use that 😅

@fiatjaf
Copy link
Owner

fiatjaf commented Apr 27, 2023

The best fix would be to have a separate table for the tags to be queried.

What are you building? If you just want a simple sqlite-based relay for testing in the meantime I think you should probably use https://github.com/scsibug/nostr-rs-relay.

@bndw
Copy link
Contributor Author

bndw commented Apr 27, 2023

https://www.stemstr.app/

The backend is a relay + a couple endpoints for streaming stuff. I liked the idea of relayer because I can effectively embed the relay in the api and have hooks into the various relay lifecycles. Do you know of any other relay frameworks in Go?

@fiatjaf
Copy link
Owner

fiatjaf commented Apr 27, 2023

No, I don't, I don't know of any other relay frameworks in any language except for this one!

Wow, stemstr.app is looking great!, but hey, if that is your use case you should use the Postgres backend.

@bndw
Copy link
Contributor Author

bndw commented Apr 27, 2023

Thanks. I was planning to swap to the Postgres backend, I guess the time has come 😂

@bndw
Copy link
Contributor Author

bndw commented Apr 27, 2023

I was able to reproduce this problem using the Postgres backend.

@fiatjaf
Copy link
Owner

fiatjaf commented Apr 27, 2023

No way.

@fiatjaf
Copy link
Owner

fiatjaf commented Apr 27, 2023

Well, I guess we should fix it now then.

@bndw
Copy link
Contributor Author

bndw commented Apr 27, 2023

I apologize, after testing the Postgres backend again this morning I'm able to query by multiple #e tags. Too much debugging yesterday, sorry for the false alarm!

Almost certain this is a real issue in the sqlite backend.

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