Format query.

Raw string literals at your service.
Get rid of unwanted dynamic casts.
Store sid rule exception actions in std::unordered_set.