runWithInterceptor<T> method
Executes action 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
Future<T> runWithInterceptor<T>(
Future<T> Function() action, {
required QueryInterceptor interceptor,
}) async {
final session = await currentSession();
return _runConnectionZoned(
_ScopedDatabaseSession(
session.interceptWith(interceptor),
currentStreamQueryStore(),
),
action,
);
}