What's the best approach to prevent sql injection with n1ql?

Okay, I’ve tried a few more tests…and yes, I can use partial index. It requires more code (to fetch form values and validate) and selectively binding values, but I think it’s the best approach for now.

To summarize…

  • just put values into query string if those values are validated by a map or some other means.
  • bind user input values and use partial index.

Thank you @geraldss for answering over the weekend. I really appreciate it.

1 Like