QueryResult class
Represents the result of a SQL query execution.
Contains the column names, row data, and row count. Each row is a list of dynamic values corresponding to the columns in the same order.
Example:
final result = QueryResult(
columns: ['id', 'name', 'age'],
rows: [
[1, 'Alice', 30],
[2, 'Bob', 25],
],
rowCount: 2,
);
Constructors
-
QueryResult({required List<
String> columns, required List<List> rows, required int rowCount}) -
Creates a new QueryResult instance.
const
Properties
-
columns
→ List<
String> -
Column names in the order they appear in the query result.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- isEmpty → bool
-
Returns true if the result set contains no rows.
no setter
- isNotEmpty → bool
-
Returns true if the result set contains at least one row.
no setter
- rowCount → int
-
Total number of rows in the result set.
final
-
rows
→ List<
List> -
Row data as a list of lists, where each inner list represents one row.
final
- 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
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited