Interface for query logging.
Implement this interface to receive notifications about query execution. This is useful for debugging, performance monitoring, and audit logging.
Example:
class MyLogger implements QueryLogger {
@override
void onQueryStart(QueryStartEvent event) {
print('Starting: ${event.sql}');
}
@override
void onQueryEnd(QueryEndEvent event) {
print('[${event.duration.inMilliseconds}ms] ${event.sql}');
}
@override
void onQueryError(QueryErrorEvent event) {
print('ERROR: ${event.error}');
}
}
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
onQueryEnd(
QueryEndEvent event) → void - Called after a query completes successfully.
-
onQueryError(
QueryErrorEvent event) → void - Called when a query fails.
-
onQueryStart(
QueryStartEvent event) → void - Called before a query is executed.
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited