QGIS API Documentation
3.24.2-Tisler (13c1a02865)
|
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. More... | |
long long | fetchedRowCount () const |
Returns the number of fetched rows. More... | |
bool | hasNextRow () const |
Returns true if there are more rows to fetch. More... | |
QList< QVariant > | nextRow () const |
Returns the next result row or an empty row if there are no rows left. More... | |
long long | rowCount () const |
Returns the number of rows returned by a SELECT query or Qgis::FeatureCountState::UnknownCount if unknown. More... | |
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. More... | |
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 82 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.