ResultSet

A random access range of Row.

This is being considered for deprecation in a future release of mysql-native, because the same thing can be achieved by passing a ResultRange to std.array.array().

This is returned by the mysql.commands.querySet and mysql.prepared.PreparedImpl.querySet functions.

Unlike ResultRange, this offers random access to the individual rows via array-like indexing and a length member to check the number of rows received without having to count them.

However, this random access comes with a downside: Unlike ResultRange, using ResultSet means ALL the rows are downloaded and stored in memory before you can access any of them. So use this only if you really need random-access and you're not likely to be dealing with large numbers of rows. Otherwise, consider using query to receive a ResultRange instead.

Constructors

this
this(Row[] rows, string[] colNames)
Undocumented in source.

Members

Aliases

opDollar
alias opDollar = length
Undocumented in source.

Functions

asAA
Variant[string] asAA()

Get a row as an associative array by column name

opIndex
Row opIndex(size_t i)

Make the ResultSet behave as a random access range - opIndex

popBack
void popBack()

Make the ResultSet behave as a random access range - popBack

popFront
void popFront()

Make the ResultSet behave as a random access range - popFront()

revert
void revert()

Restore the range to its original span.

Properties

back
inout(Row) back [@property getter]

Make the ResultSet behave as a random access range - back

colNameIndicies
const(size_t[string]) colNameIndicies [@property getter]

An AA to lookup a column's index by name

colNames
const(string)[] colNames [@property getter]

Get the names of all the columns

empty
bool empty [@property getter]

Make the ResultSet behave as a random access range - empty

front
inout(Row) front [@property getter]

Make the ResultSet behave as a random access range - front

length
size_t length [@property getter]

Make the ResultSet behave as a random access range - length

save
ResultSet save [@property getter]

Make the ResultSet behave as a random access range - save

Meta