fastcgi++  3.1alpha
A C++ FastCGI/Web API
Fastcgipp::SQL::Results<> Class Reference

Specialization of Results for zero sized result sets. More...

#include <fastcgi++/sql/results.hpp>

Inheritance diagram for Fastcgipp::SQL::Results<>:
[legend]
Collaboration diagram for Fastcgipp::SQL::Results<>:
[legend]

Public Member Functions

int verify () const
 Verify that the result set is zero sized. More...
 
Status status () const
 Get status of SQL query result. More...
 
const char * errorMessage () const
 Get error message associated with SQL query result. More...
 
unsigned rows () const
 How many rows were returned with the SQL query. More...
 
unsigned affectedRows () const
 How many rows were affected from the SQL query. More...
 
bool null (int row, int column) const
 Check for nullness of a specific row/column. More...
 
template<typename Numeric >
void field (int row, int column, Numeric &value) const
 

Protected Member Functions

int columns () const
 How many columns are associated with the underlying results. More...
 
template<typename T >
bool verifyColumn (int column) const
 Verify type and size consistency for the specified column. More...
 
template<typename Numeric >
void field (int row, int column, std::vector< Numeric > &value) const
 Extract typed array from specific row and column. More...
 
template<typename T >
void field (int row, int column, T &value) const
 Extract typed value from specific row and column. More...
 
template<>
void field (int row, int column, bool &value) const
 
template<>
void field (int row, int column, std::vector< char > &value) const
 

Protected Attributes

void * m_res
 Pointer to underlying SQL results object. More...
 

Detailed Description

Specialization of Results for zero sized result sets.

Definition at line 277 of file results.hpp.

Member Function Documentation

◆ affectedRows()

unsigned Fastcgipp::SQL::Results_base::affectedRows ( ) const
inherited

How many rows were affected from the SQL query.

Definition at line 463 of file results.cpp.

References Fastcgipp::Http::atoi().

Here is the call graph for this function:

◆ columns()

int Fastcgipp::SQL::Results_base::columns ( ) const
protectedinherited

How many columns are associated with the underlying results.

Definition at line 492 of file results.cpp.

Referenced by Fastcgipp::SQL::Results< Types >::verify().

Here is the caller graph for this function:

◆ errorMessage()

const char * Fastcgipp::SQL::Results_base::errorMessage ( ) const
inherited

Get error message associated with SQL query result.

Definition at line 474 of file results.cpp.

◆ field() [1/5]

template<>
void Fastcgipp::SQL::Results_base::field ( int  row,
int  column,
bool &  value 
) const
protectedinherited

Definition at line 120 of file results.cpp.

◆ field() [2/5]

template<typename Numeric >
void Fastcgipp::SQL::Results_base::field ( int  row,
int  column,
Numeric &  value 
) const
inherited

Definition at line 85 of file results.cpp.

References Fastcgipp::BigEndian< T >::read().

Here is the call graph for this function:

◆ field() [3/5]

template<>
void Fastcgipp::SQL::Results_base::field ( int  row,
int  column,
std::vector< char > &  value 
) const
protectedinherited

Definition at line 297 of file results.cpp.

◆ field() [4/5]

template<typename Numeric >
void Fastcgipp::SQL::Results_base::field ( int  row,
int  column,
std::vector< Numeric > &  value 
) const
protectedinherited

Extract typed array from specific row and column.

Definition at line 213 of file results.cpp.

References WARNING_LOG.

Referenced by Fastcgipp::SQL::Results< Types >::verify_impl().

Here is the caller graph for this function:

◆ field() [5/5]

template<typename T >
void Fastcgipp::SQL::Results_base::field ( int  row,
int  column,
T &  value 
) const
protectedinherited

Extract typed value from specific row and column.

This function has no default definition and must be specialized for each and every type that is to be used.

◆ null()

bool Fastcgipp::SQL::Results_base::null ( int  row,
int  column 
) const
inherited

Check for nullness of a specific row/column.

Definition at line 484 of file results.cpp.

◆ rows()

unsigned Fastcgipp::SQL::Results_base::rows ( ) const
inherited

How many rows were returned with the SQL query.

Definition at line 479 of file results.cpp.

Referenced by Fastcgipp::SQL::Results< Types >::verify().

Here is the caller graph for this function:

◆ status()

Fastcgipp::SQL::Status Fastcgipp::SQL::Results_base::status ( ) const
inherited

Get status of SQL query result.

This function should be called first thing after an SQL query is complete to ensure the result of the query is what you expect it to be.

Definition at line 433 of file results.cpp.

References Fastcgipp::SQL::badResponse, Fastcgipp::SQL::commandOk, Fastcgipp::SQL::copyBoth, Fastcgipp::SQL::copyIn, Fastcgipp::SQL::copyOut, Fastcgipp::SQL::emptyQuery, Fastcgipp::SQL::fatalError, Fastcgipp::SQL::nonfatalError, Fastcgipp::SQL::noResult, Fastcgipp::SQL::rowsOk, and Fastcgipp::SQL::singleTuple.

◆ verify()

int Fastcgipp::SQL::Results<>::verify ( ) const
inline

Verify that the result set is zero sized.

Definition at line 281 of file results.hpp.

◆ verifyColumn()

template<typename T >
template bool Fastcgipp::SQL::Results_base::verifyColumn< double > ( int  column) const
protectedinherited

Verify type and size consistency for the specified column.

This function has no default definition and must be specialized for each and every type that is to be used.

Definition at line 41 of file results.cpp.

References Fastcgipp::SQL::Results_base::m_res.

Member Data Documentation

◆ m_res

void* Fastcgipp::SQL::Results_base::m_res
protectedinherited

Pointer to underlying SQL results object.

Definition at line 130 of file results.hpp.

Referenced by Fastcgipp::SQL::Results_base::verifyColumn().


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