Closed gdsfh closed 6 years ago
This appears to be an unfortunate feature conflict, but it is easily overridable with explicit -params unnamed
. There is a difference between none
and unnamed
. none
means do not change anything in the query. But values list is generated by sqlgg and it is generated with named parameters. I think it would be best to remove -params none
altogether and make -params unnamed
the default..
Both @param
and ?
in query works with none
(sqlgg treat them as parameters). Also none
is an useful mode.
So maybe it's better to fail with error when -params none
is set and sqlgg needs to generate (@col1, @col2, ...)
? So that user could either set -params <not-none>
or supply (@col1, @col2 ...)
or (?, ? ...)
manually, depending on whether he really needs none
.
Thanks, agree with your analysis. The only question is whether none
is really needed. Reducing complexity is always a win.
I don't use
-params
option (so sqlgg assumes-params none
as default), but sqlgg generates following code for insert:Here parameters are named, and error passes through compile-time to run-time (since my current rdbms cannot into named parameters), which is not in the spirit of sqlgg: