Replies: 1 comment 1 reply
-
When you wrote |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
It seems that the sql parser in some cases does not support positional parameters that do not correspond to properties, unlike the JDBC prepared statement, where it is possible to specify a positional parameters for each ? in the sql string.
These are the tests that I have done:
Query 1 must therefore be re-written in this way: "SELECT FROM Order ORDER BY {sort_field} {sort_order} LIMIT ?"
and the {sort_field} and {sort_order} placeholders must be replaced with the actual values before the sql string is passed to the Database.query method.
On the other hand, Query 3 shows that in this particular case, the parser can handle a positional parameter that is not linked to a property.
Apart from the possible performance improvements, I think it would be useful to enhance the parser so that it can replace each ? with a corresponding parameter.
Beta Was this translation helpful? Give feedback.
All reactions