Qt 4.8
Public Functions | Public Variables | List of all members
QPSQLResultPrivate Class Reference

Public Functions

bool processResults ()
 
 QPSQLResultPrivate (QPSQLResult *qq)
 

Public Variables

int currentSize
 
const QPSQLDriverPrivatedriver
 
bool preparedQueriesEnabled
 
QString preparedStmtId
 
QPSQLResultq
 
PGresultresult
 

Detailed Description

Definition at line 190 of file qsql_psql.cpp.

Constructors and Destructors

◆ QPSQLResultPrivate()

QPSQLResultPrivate::QPSQLResultPrivate ( QPSQLResult qq)
inline

Definition at line 193 of file qsql_psql.cpp.

193 : q(qq), driver(0), result(0), currentSize(-1), preparedQueriesEnabled(false) {}
QPSQLResult * q
Definition: qsql_psql.cpp:195
PGresult * result
Definition: qsql_psql.cpp:197
const QPSQLDriverPrivate * driver
Definition: qsql_psql.cpp:196

Functions

◆ processResults()

bool QPSQLResultPrivate::processResults ( )

Definition at line 217 of file qsql_psql.cpp.

Referenced by QPSQLResult::exec(), and QPSQLResult::reset().

218 {
219  if (!result)
220  return false;
221 
222  int status = PQresultStatus(result);
223  if (status == PGRES_TUPLES_OK) {
224  q->setSelect(true);
225  q->setActive(true);
226  currentSize = PQntuples(result);
227  return true;
228  } else if (status == PGRES_COMMAND_OK) {
229  q->setSelect(false);
230  q->setActive(true);
231  currentSize = -1;
232  return true;
233  }
235  "Unable to create query"), QSqlError::StatementError, driver, result));
236  return false;
237 }
QPSQLResult * q
Definition: qsql_psql.cpp:195
PGresult * result
Definition: qsql_psql.cpp:197
static LibLoadStatus status
Definition: qlocale_icu.cpp:69
static QString translate(const char *context, const char *key, const char *disambiguation=0, Encoding encoding=CodecForTr)
virtual void setLastError(const QSqlError &e)
This function is provided for derived classes to set the last error to error.
Definition: qsqlresult.cpp:417
virtual void setSelect(bool s)
This function is provided for derived classes to indicate whether or not the current statement is a S...
Definition: qsqlresult.cpp:367
static QSqlError qMakeError(const QString &err, QSqlError::ErrorType type, const QPSQLDriverPrivate *p, PGresult *result=0)
Definition: qsql_psql.cpp:205
virtual void setActive(bool a)
This function is provided for derived classes to set the internal active state to active...
Definition: qsqlresult.cpp:402
const QPSQLDriverPrivate * driver
Definition: qsql_psql.cpp:196

Properties

◆ currentSize

int QPSQLResultPrivate::currentSize

Definition at line 198 of file qsql_psql.cpp.

Referenced by QPSQLResult::cleanup(), QPSQLResult::fetch(), and QPSQLResult::size().

◆ driver

const QPSQLDriverPrivate* QPSQLResultPrivate::driver

◆ preparedQueriesEnabled

bool QPSQLResultPrivate::preparedQueriesEnabled

◆ preparedStmtId

QString QPSQLResultPrivate::preparedStmtId

◆ q

QPSQLResult* QPSQLResultPrivate::q

Definition at line 195 of file qsql_psql.cpp.

Referenced by QPSQLResult::exec().

◆ result

PGresult* QPSQLResultPrivate::result

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