You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Ohad Shai edited this page Jun 4, 2019
·
4 revisions
Interceptors allow operating on queries globally from a single point. This can simplify cross-cutting concerns like logging, tracing, metrics measurements, and thread local transformations.
Implementation
To implement an interceptor, one should inherit from QueryInterceptor. There are methods that allow intercepting a query or a prepared statement.
For example, the below method gets the query string and is expected to return it.
funinterceptQuery(query:String): String
Manipulating the value and returning a different value allows manipulating statements globally.
The interceptQueryComplete allows installing a hook on the result itself in a similar manner.
Once interceptor is implemented, add it to the pool configuration or connection configuration.