QueryExceptionExecutor class final

Wraps an executor so a failing query throws QueryException, or UniqueConstraintViolationException when errors recognises one, as Laravel's runQueryCallback does.

Implemented types

Constructors

QueryExceptionExecutor(QueryExecutor inner, String connectionName, QueryErrors? errors)
Wraps inner, recognising unique violations through errors.

Properties

connectionName → String
The connection name reported in errors.
final
dialect → SqlDialect
The SQL dialect of this connection.
no setteroverride
errors → QueryErrors?
The driver's error classifier, when it has one.
final
hashCode → int
The hash code for this object.
no setterinherited
inner → QueryExecutor
The wrapped executor.
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