Struct ResultSet

A random access range of Row.

struct ResultSet ;

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 querySet and 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.

Properties

NameTypeDescription
back[get] inout(Row)Make the ResultSet behave as a random access range - back
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] boolMake the ResultSet behave as a random access range - empty
front[get] inout(Row)Make the ResultSet behave as a random access range - front
length[get] ulongMake the ResultSet behave as a random access range - length
save[get] ResultSetMake the ResultSet behave as a random access range - save

Methods

NameDescription
asAA Get a row as an associative array by column name
opIndex Make the ResultSet behave as a random access range - opIndex
popBack Make the ResultSet behave as a random access range - popBack
popFront Make the ResultSet behave as a random access range - popFront()
revert Restore the range to its original span.

Aliases

NameDescription
opDollar Make the ResultSet behave as a random access range - length