In MysqlConnection, this is how you check the amou...
# jasync-sql
d
In MysqlConnection, this is how you check the amount of params
Copy code
val totalParameters = params.query.count { it == '?' }
I guess it's the same in postgres, where really it should be a regex to make sure that the
?
is not surrounded by quotes.
o
yes, it's pretty simplistic. we dont really parse the request
can you open an issue for that?
d
Sure
I guess there isn't really any workarounds for this 🙈?
At least until it gets fixed...
o
the workaround is to use query instead of prepared statement
the fix will probably be a simpler check. I don't want to compile the expression
d
I don't know how much you'll save from a simpler check... compiling the expression is only once per connection creation.
You might want to benchmark the difference between the "simpler" algorithm (using a biggish/complex sql statement) and the regex version
o
do you know how to compile it?
can you try double question marks? https://github.com/jasync-sql/jasync-sql/issues/196
d
It does't really make sense that ?? should help, but we can try...
params.query.count { it == '?' }
should report two extra ? instead of one...
It does work though 🤔...
Oh... the implementation of Mysql's
PreparedStatementHolder
is different.