|
|||
|
|||
|
Inheritance diagram for PgSQLresult:


Public Member Functions | |
| PgSQLresult (Module *self, Module *to, unsigned long rid, PGresult *result) | |
| ~PgSQLresult () | |
| virtual int | Rows () |
| Return the number of rows in the result Note that if you have perfomed an INSERT or UPDATE query or other query which will not return rows, this will return the number of affected rows, and SQLresult::Cols() will contain 0. | |
| virtual int | Cols () |
| Return the number of columns in the result. | |
| virtual std::string | ColName (int column) |
| Get a string name of the column by an index number. | |
| virtual int | ColNum (const std::string &column) |
| Get an index number for a column from a string name. | |
| virtual SQLfield | GetValue (int row, int column) |
| Get a string value in a given row and column This does not effect the internal cursor. | |
| virtual SQLfieldList & | GetRow () |
| Return a list of values in a row, this should increment an internal counter so you can repeatedly call it until it returns an empty vector. | |
| virtual SQLfieldMap & | GetRowMap () |
| As above, but return a map indexed by key name. | |
| virtual SQLfieldList * | GetRowPtr () |
| Like GetRow(), but returns a pointer to a dynamically allocated object which must be explicitly freed. | |
| virtual SQLfieldMap * | GetRowMapPtr () |
| As above, but return a map indexed by key name The internal cursor (row counter) is incremented by one. | |
| virtual void | Free (SQLfieldMap *fm) |
| Overloaded function for freeing the lists and maps returned by GetRowPtr or GetRowMapPtr. | |
| virtual void | Free (SQLfieldList *fl) |
| Overloaded function for freeing the lists and maps returned by GetRowPtr or GetRowMapPtr. | |
Private Attributes | |
| PGresult * | res |
| int | currentrow |
| int | rows |
| int | cols |
| SQLfieldList * | fieldlist |
| SQLfieldMap * | fieldmap |
All SQL providers must create their own subclass and define it's methods using that database library's data retriveal functions. The aim is to avoid a slow and inefficient process of converting all data to a common format before it reaches the result structure. This way data is passes to the module nearly as directly as if it was using the API directly itself.
Definition at line 121 of file m_pgsql.cpp.
|
||||||||||||||||||||
|
Definition at line 131 of file m_pgsql.cpp. |
|
|
Definition at line 138 of file m_pgsql.cpp. |
|
|
Get a string name of the column by an index number.
Implements SQLresult. Definition at line 167 of file m_pgsql.cpp. References res. Referenced by GetRowMap(), and GetRowMapPtr(). |
|
|
Get an index number for a column from a string name. An exception of type SQLbadColName will be thrown if the name given is invalid.
Implements SQLresult. Definition at line 174 of file m_pgsql.cpp. References res. |
|
|
Return the number of columns in the result. If you performed an UPDATE or INSERT which does not return a dataset, this value will be 0.
Implements SQLresult. Definition at line 162 of file m_pgsql.cpp. References res. |
|
|
Overloaded function for freeing the lists and maps returned by GetRowPtr or GetRowMapPtr.
Implements SQLresult. Definition at line 303 of file m_pgsql.cpp. |
|
|
Overloaded function for freeing the lists and maps returned by GetRowPtr or GetRowMapPtr.
Implements SQLresult. Definition at line 298 of file m_pgsql.cpp. |
|
|
Return a list of values in a row, this should increment an internal counter so you can repeatedly call it until it returns an empty vector. This returns a reference to an internal object, the same object is used for all calls to this function and therefore the return value is only valid until you call this function again. It is also invalid if the SQLresult object is destroyed. The internal cursor (row counter) is incremented by one.
Implements SQLresult. Definition at line 202 of file m_pgsql.cpp. References currentrow, fieldlist, GetValue(), and res. |
|
|
As above, but return a map indexed by key name. The internal cursor (row counter) is incremented by one.
Implements SQLresult. Definition at line 231 of file m_pgsql.cpp. References ColName(), currentrow, fieldmap, GetValue(), and res. |
|
|
As above, but return a map indexed by key name The internal cursor (row counter) is incremented by one.
Implements SQLresult. Definition at line 279 of file m_pgsql.cpp. References ColName(), currentrow, GetValue(), and res. |
|
|
Like GetRow(), but returns a pointer to a dynamically allocated object which must be explicitly freed. For portability reasons this must be freed with SQLresult::Free() The internal cursor (row counter) is incremented by one.
Implements SQLresult. Definition at line 260 of file m_pgsql.cpp. References currentrow, GetValue(), and res. |
|
||||||||||||
|
Get a string value in a given row and column This does not effect the internal cursor.
Implements SQLresult. Definition at line 188 of file m_pgsql.cpp. References res. Referenced by GetRow(), GetRowMap(), GetRowMapPtr(), and GetRowPtr(). |
|
|
Return the number of rows in the result Note that if you have perfomed an INSERT or UPDATE query or other query which will not return rows, this will return the number of affected rows, and SQLresult::Cols() will contain 0. In this case you SHOULD NEVER access any of the result set rows, as there arent any!
Implements SQLresult. Definition at line 150 of file m_pgsql.cpp. |
|
|
Definition at line 126 of file m_pgsql.cpp. Referenced by PgSQLresult(), and Rows(). |
|
|
Definition at line 124 of file m_pgsql.cpp. Referenced by GetRow(), GetRowMap(), GetRowMapPtr(), and GetRowPtr(). |
|
|
Definition at line 128 of file m_pgsql.cpp. Referenced by GetRow(), and ~PgSQLresult(). |
|
|
Definition at line 129 of file m_pgsql.cpp. Referenced by GetRowMap(), and ~PgSQLresult(). |
|
|
Definition at line 123 of file m_pgsql.cpp. Referenced by ColName(), ColNum(), Cols(), GetRow(), GetRowMap(), GetRowMapPtr(), GetRowPtr(), GetValue(), PgSQLresult(), Rows(), and ~PgSQLresult(). |
|
|
Definition at line 125 of file m_pgsql.cpp. Referenced by PgSQLresult(), and Rows(). |