MySQL Connector/C++
MySQL connector library for C and C++ applications
Public Member Functions | List of all members

Result of an operation that returns rows. More...

Public Member Functions

col_count_t getColumnCount () const
 Return the number of fields in each row.
 
const ColumngetColumn (col_count_t pos) const
 Return Column object describing the given column of the result.
 
const Columns & getColumns () const
 Return meta-data for all result columns. More...
 
Row fetchOne ()
 Return the current row and move to the next one in the sequence. More...
 
RowList fetchAll ()
 Return all remaining rows. More...
 
row_count_t count ()
 Returns the number of rows contained in the result. More...
 

Detailed Description

Result of an operation that returns rows.

A RowResult object gives sequential access to the rows contained in the result. It is possible to get the rows one-by-one, or fetch and store all of them at once. One can iterate over the rows using range loop: for (Row r : result) ....

Member Function Documentation

◆ getColumns()

const Columns& getColumns ( ) const
inline

Return meta-data for all result columns.

TODO: explain ownership

◆ fetchOne()

Row fetchOne ( )
inline

Return the current row and move to the next one in the sequence.

If there are no more rows in this result, returns a null Row instance.

◆ fetchAll()

RowList fetchAll ( )
inline

Return all remaining rows.

Result of this method can be stored in a container such as std::list<Row>. Rows that have already been fetched using fetchOne() are not included in the result of fetchAll().

◆ count()

row_count_t count ( )
inline

Returns the number of rows contained in the result.

The method counts only the rows that were not yet fetched and are still available in the result.


The documentation for this class was generated from the following file: