ListeningQueryExecutor class final

Wraps an executor to report every query to listeners. Only used while listeners are registered, so queries cost nothing extra otherwise.

Implemented types

Constructors

ListeningQueryExecutor(QueryExecutor inner, String connectionName, List<void Function(QueryExecuted event)> listeners)
Reports the queries of inner on connectionName to listeners.

Properties

connectionName → String
The connection name reported.
final
dialect → SqlDialect
The SQL dialect of this connection.
no setteroverride
hashCode → int
The hash code for this object.
no setterinherited
inner → QueryExecutor
The wrapped executor.
final
listeners → List<void Function(QueryExecuted event)>
The DB.listen callbacks.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

execute(String sql, [List<Object?> bindings = const <Object?>[]]) → Future<int>
Runs a statement and returns the number of affected rows.
override
insertGetId(String sql, [List<Object?> bindings = const <Object?>[]]) → Future<Object?>
Runs an insert and returns the generated primary key.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
select(String sql, [List<Object?> bindings = const <Object?>[]]) → Future<List<Map<String, Object?>>>
Runs a query and returns the rows as column → value maps.
override
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited