The following rewrite rule works as expected:
%%
regex_grammar: Awk
case_sensitive: false
ignore_whitespace: true
%
SELECT msg FROM mytable WHERE id = 123
%
SELECT msg FROM mytable WHERE id = sha1(123)
My question now is, how can I write this query with placeholder in regex_grammer: Awk. If I knew that, I would have a breakthrough for the next problem. My actual goal is to rewrite the following query:
Input:
SELECT msg FROM mytable WHERE id IN (123,456,769)
Output:
SELECT msg FROM mytable WHERE id IN (sha1(123),sha1(456),sha1(769))
I assume that this only works with regex_grammar Awk and not with Native. Am I right?
This is the only documentation that I found: https://mariadb.com/kb/en/mariadb-maxscale-2208-rewrite-filter/
I also accept other suggestions or tools! Maxscale looked the most promising solution to me.