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

don't execute n1ql request with key params at nil #43

Open
giallon opened this issue Sep 14, 2022 · 0 comments
Open

don't execute n1ql request with key params at nil #43

giallon opened this issue Sep 14, 2022 · 0 comments
Labels
bug Something isn't working

Comments

@giallon
Copy link
Collaborator

giallon commented Sep 14, 2022

If we have Mission class

class Mission
   n1ql: by_route, emit_key: route_id
end

and we call by_route with key params at nil

Mission.by_route(key: nil).last

then this method will build this request N1QL : SELECT raw meta().id FROM default WHERE type=“mission“ ORDER BY route_id asc,meta().id asc

It's very dangerous. Request N1QL is used by association (has_many)

@giallon giallon added the bug Something isn't working label Sep 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant