lintel 0.2.0
Loading...
Searching...
No Matches
Public Member Functions | List of all members
lintel::postgresql::Result Class Reference

#include <Result.h>

Public Member Functions

 Result (PGresult *res)
 
 ~Result ()
 
bool isState (ExecStatusType status) const
 
std::string getValue (int row, int attribute) const
 
int getNumOfAttributes () const
 
int getSize () const
 
db::Arguments & of (std::size_t pos)
 

Detailed Description

Wraps a PostgreSQL PGresult and provides row/column access.

Constructor & Destructor Documentation

◆ Result()

lintel::postgresql::Result::Result ( PGresult *  res)
explicit

Constructs a Result from a PGresult pointer, taking ownership.

Parameters
resthe PGresult pointer

◆ ~Result()

lintel::postgresql::Result::~Result ( )

Destructor, frees the PGresult.

Member Function Documentation

◆ getNumOfAttributes()

int lintel::postgresql::Result::getNumOfAttributes ( ) const
Returns
the number of columns in the result

◆ getSize()

int lintel::postgresql::Result::getSize ( ) const
Returns
the number of rows in the result

◆ getValue()

std::string lintel::postgresql::Result::getValue ( int  row,
int  attribute 
) const

Retrieves a value at the given row and column.

Parameters
rowthe row index
attributethe column index
Returns
the value as a string

◆ isState()

bool lintel::postgresql::Result::isState ( ExecStatusType  status) const

Checks whether the result has the given execution status.

Parameters
statusthe expected ExecStatusType
Returns
true if the result status matches

◆ of()

db::Arguments & lintel::postgresql::Result::of ( std::size_t  pos)

Accesses a row's arguments (mutable).

Parameters
posthe row index
Returns
reference to the Arguments for that row

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