QGIS API Documentation 3.41.0-Master (45a0abf3bec)
|
The QueryResult class represents the result of a query executed by execSql() More...
#include <qgsabstractdatabaseproviderconnection.h>
Public Member Functions | |
QStringList | columns () const |
Returns the column names. | |
long long | fetchedRowCount () const |
Returns the number of fetched rows. | |
bool | hasNextRow () const |
Returns true if there are more rows to fetch. | |
QList< QVariant > | nextRow () const |
Returns the next result row or an empty row if there are no rows left. | |
long long | rowCount () const |
Returns the number of rows returned by a SELECT query or Qgis::FeatureCountState::UnknownCount if unknown. | |
QList< QList< QVariant > > | rows (QgsFeedback *feedback=nullptr) |
Returns the result rows by calling the iterator internally and fetching all the rows, an optional feedback can be used to interrupt the fetching loop. | |
The QueryResult class represents the result of a query executed by execSql()
It encapsulates an iterator over the result rows and a list of the column names.
Rows can be retrieved by iterating over the result with hasNextRow() and nextRow() or by calling rows() that will internally iterate over the results and return the whole result list.
Definition at line 87 of file qgsabstractdatabaseproviderconnection.h.
QStringList QgsAbstractDatabaseProviderConnection::QueryResult::columns | ( | ) | const |
Returns the column names.
long long QgsAbstractDatabaseProviderConnection::QueryResult::fetchedRowCount | ( | ) | const |
Returns the number of fetched rows.
bool QgsAbstractDatabaseProviderConnection::QueryResult::hasNextRow | ( | ) | const |
Returns true
if there are more rows to fetch.
QList< QVariant > QgsAbstractDatabaseProviderConnection::QueryResult::nextRow | ( | ) | const |
Returns the next result row or an empty row if there are no rows left.
long long QgsAbstractDatabaseProviderConnection::QueryResult::rowCount | ( | ) | const |
Returns the number of rows returned by a SELECT query or Qgis::FeatureCountState::UnknownCount if unknown.
QList< QList< QVariant > > QgsAbstractDatabaseProviderConnection::QueryResult::rows | ( | QgsFeedback * | feedback = nullptr | ) |
Returns the result rows by calling the iterator internally and fetching all the rows, an optional feedback can be used to interrupt the fetching loop.