interceptWith method

QueryExecutor interceptWith(
  1. QueryInterceptor interceptor
)

Returns a QueryExecutor that will use this executor internally, but with calls intercepted by the given interceptor.

This can be used to, for instance, write a custom statement logger or to retry failing statements automatically.

Implementation

QueryExecutor interceptWith(QueryInterceptor interceptor) {
  final $this = this;

  if ($this is TransactionExecutor) {
    return _InterceptedTransactionExecutor($this, interceptor);
  } else {
    return _InterceptedExecutor($this, interceptor);
  }
}