-
Jean Boussier authored
Hooking into `execute` and `exec_query` is problematic because some adapters like MySQL2 have `exec_query` call `execute` which forces QueryLogs to first check wether the comment was already applied. Using a prepended module is also a bit problematic because it means it has to be prepended to the "final" adapter classes but if the user application has a custom adapter that inherits from a built-in one, the built-in one no longer have QueryLogs working. So instead this PR introduce `ActiveRecord.query_transformers`, and the adpters are responsible for applying to transformers only once.
Jean Boussier authoredHooking into `execute` and `exec_query` is problematic because some adapters like MySQL2 have `exec_query` call `execute` which forces QueryLogs to first check wether the comment was already applied. Using a prepended module is also a bit problematic because it means it has to be prepended to the "final" adapter classes but if the user application has a custom adapter that inherits from a built-in one, the built-in one no longer have QueryLogs working. So instead this PR introduce `ActiveRecord.query_transformers`, and the adpters are responsible for applying to transformers only once.
Loading