Closed davsclaus closed 9 years ago
Does this branch cover the need here?
Oh thanks @jodastephen I will build from the branch and test it in Camel
Perfect this worked like a charm.
I can do
@NAME(projectsByIdBody)
SELECT *
FROM projects
WHERE license = :${body.license}
ORDER BY id
Are you happy for me to merge this then?
+1 thanks alot for the speedy solution.
Hi
As I developed the camel-elsql [1] component its based on an existing camel-sql component. In the latter we also support named parameters but the syntax is slightly different, we use :# as the marker for a named parameter. However we allow the named parameter to present a function that we evaluate at runtime to fetch the actual value.
for example
Where the function is represented using
${xxxx}
When using ElSql that does not work, as I cannot do in
At runtime that gives me a parameter name in the
hasParameter
callback with the value of:${body.user.firstName
. Notice the last}
is missing. I also noticed that in other combos that the value was empty.I just logged this ticket here in the morning to ask whether ElSql would consider some kind of support for named parameters as functions. I guess the problem could be parsing the syntax.
Though I am considering in the next Camel release to consider the parameter name as a function if there is no direct hit, so you can do
Anyway just wanted to say thanks as well for this great SQL library. I love that it allows me to work with SQL externally and that they resemble actual SQL. That is why I also like MyBatis etc. But this library is even lighter.