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, List outputParamValues = const <dynamic>[], List<QueryResult> refCursorResults = const <QueryResult>[], List<DirectedMultiItem> additionalResults = const <DirectedMultiItem>[]})
Creates a new QueryResult instance.
const

Properties

additionalResults List<DirectedMultiItem>
Additional result sets and row-counts returned by a directed OUT call when the stored procedure / batch produced more than one ODBC result after SQLMoreResults (the MULT envelope path).
final
columns List<String>
Column names in the order they appear in the query result.
final
hasAdditionalResults bool
True when additionalResults is non-empty.
no setter
hashCode int
The hash code for this object.
no setterinherited
hasOutputParamValues bool
True when outputParamValues is non-empty.
no setter
hasRefCursorResults bool
True when refCursorResults is non-empty.
no setter
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
outputParamValues List
Values for OUT / INOUT parameters, when a directed (DRT1) execute is used and the engine appends the OUT1 footer. Empty when the query used only INPUT parameters or a legacy v0 parameter buffer. Entries are typically the sealed ParamValue types from the package's param_value protocol — scalar OUT/INOUT only (no ParamValueRefCursorOut); see doc/notes/TYPE_MAPPING.md §3.1.1.
final
refCursorResults List<QueryResult>
When the native RC1\0 trailer is present, each entry is a full result set materialized from a SYS_REFCURSOR (or similar) OUT parameter.
final
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