mysql-native v1.2.0
API Reference Home: [This Version] [Latest Version] [Other Versions]
Struct ResultRange
An input range of Row.
struct ResultRange
;
This is returned by the query
and
PreparedImpl
functions.
The rows are downloaded one-at-a-time, as you iterate the range. This allows for low memory usage, and quick access to the results as they are downloaded. This is especially ideal in case your query results in a large number of rows.
However, because of that, this ResultRange
cannot offer random access or
a length
member. If you need random access, then just like any other range,
you can simply convert this range to an array via
std
.
Properties
Name | Type | Description |
---|---|---|
colNameIndicies [get]
|
const(ulong[string]) | An AA to lookup a column's index by name |
colNames [get]
|
const(string)[] | Get the names of all the columns |
empty [get]
|
bool | Make the ResultRange behave as an input range - empty |
front [get]
|
inout(Row) | Make the ResultRange behave as an input range - front |
isValid [get]
|
bool | Check whether the range can still we used, or has been invalidated |
rowCount [get]
|
ulong | Get the number of currently retrieved. |
Methods
Name | Description |
---|---|
asAA
|
Get the current row as an associative array by column name |
close
|
Explicitly clean up the MySQL resources and cancel pending results |
popFront
|
Make the ResultRange behave as am input range - popFront() |
Type Mappings
See the MySQL/D Type Mappings tables
Example
ResultRange oneAtATime = myConnection .query("SELECT * from myTable");
Row[] allAtOnce = myConnection .query("SELECT * from myTable") .array;