DbResult class

Represents the result of a database operation.

Contains the rows returned by the query, metadata such as affected rows, optional insert ID, and execution time for performance tracking.

Constructors

DbResult({required List<Map<String, dynamic>> rows, int? affectedRows, dynamic insertId, Duration? executionTime})
Creates a new DbResult.
const

Properties

affectedRows → int?
The number of rows affected by the operation.
final
executionTime → Duration?
The duration it took to execute the query.
final
first → Map<String, dynamic>?
Returns the first row in the result set, or null if empty.
no setter
hashCode → int
The hash code for this object.
no setterinherited
insertId → dynamic
The ID of the newly inserted row, if applicable.
final
isEmpty → bool
Returns true if the result set contains no rows.
no setter
isNotEmpty → bool
Returns true if the result set is not empty.
no setter
rows → List<Map<String, dynamic>>
The list of rows returned by the query.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

firstAs<T>(T mapper(Map<String, dynamic> row)) → T?
Returns the first row mapped to T, or null if the result is empty.
map<T>(T mapper(Map<String, dynamic> row)) → List<T>
Maps every row to T using mapper and returns the list.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() → String
A string representation of this object.
inherited

Operators

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