Logging: Make it possible to parse params in the query event #16451
Labels
kind/feature
A request for a new feature.
team/client
Issue for team Client.
tech/engines/query engine
Issue in the Query Engine
topic: logging
Discussed in #14158
Originally posted by tmtron July 5, 2022
In the query event we get the
query
which can include?
placeholders and theparams
which is an array-like string: e.g.[\"abc2\",2022-07-05 14:18:03.680719400 UTC,2]
We'd like to write a convenience function to replace the
?
with the actual param values - just for readability of the log-messages during development (It can be quite difficult to understand a long query with multiple parameters)I tried to write a simple parsing logic for the params, but I think, currently there is no reliable way to parse that string (i.e. to get the individual items), because quotes and commas within a string are not escaped
a "," in a string
, and the 2nd parameter isp2
theparams
array is[\"a \",\" in a string\",\"p2\"]
a "," in a string
andp2
a "
and" in a string","p2"
Notes:
params
?The text was updated successfully, but these errors were encountered: