A result set returned from a SQL query.
More...
#include <sqlitepp/sqlitepp.h>
|
bool | canRead () const |
| Checks whether there is data to read. More...
|
|
int | columnCount () const |
| Returns the column count of the result data. More...
|
|
bool | next () |
| Steps to the next row of the result (if there is one). More...
|
|
double | readDouble (const int column) const |
| Returns the current double value of the result column with the given index. More...
|
|
int | readInt (const int column) const |
| Returns the current integer value of the result column with the given index. More...
|
|
std::string | readString (const int column) const |
| Returns the current string value of the result column with the given index. More...
|
|
A result set returned from a SQL query.
As long as there is data (canRead()
), you can read it using the read*Type*
methods. To advance to the next row, use next()
.
◆ canRead()
bool sqlitepp::ResultSet::canRead |
( |
| ) |
const |
Checks whether there is data to read.
- Returns
true
if there is data to read; otherwise false
◆ columnCount()
int sqlitepp::ResultSet::columnCount |
( |
| ) |
const |
Returns the column count of the result data.
You may only call this method when there is data to read (canRead()).
- Returns
- the column count of the result
- Exceptions
-
std::logic_error | if the statement is not open or there is no data to read |
◆ next()
bool sqlitepp::ResultSet::next |
( |
| ) |
|
Steps to the next row of the result (if there is one).
- Returns
true
if there is new data to read or false
if there are no more results
- Exceptions
-
std::logic_error | if the statement is not open |
DatabaseError | if a database error occurs during the query execution |
◆ readDouble()
double sqlitepp::ResultSet::readDouble |
( |
const int |
column | ) |
const |
Returns the current double value of the result column with the given index.
You may only call this metod when there is data to read (canRead()).
- Parameters
-
column | the index of the column to read from |
- Returns
- the current value of the result column with the given index
- Exceptions
-
std::logic_error | if the statement is not open or there is no data to read |
◆ readInt()
int sqlitepp::ResultSet::readInt |
( |
const int |
column | ) |
const |
Returns the current integer value of the result column with the given index.
You may only call this metod when there is data to read (canRead()).
- Parameters
-
column | the index of the column to read from |
- Returns
- the current value of the result column with the given index
- Exceptions
-
std::logic_error | if the statement is not open or there is no data to read |
◆ readString()
std::string sqlitepp::ResultSet::readString |
( |
const int |
column | ) |
const |
Returns the current string value of the result column with the given index.
You may only call this metod when there is data to read (canRead()).
- Parameters
-
column | the index of the column to read from |
- Returns
- the current value of the result column with the given index
- Exceptions
-
std::logic_error | if the statement is not open or there is no data to read |
The documentation for this class was generated from the following files: