AnCH Framework 0.1
Another C++ Hack Framework
 
Loading...
Searching...
No Matches
anch::sql::PostgreSQLResultSet Class Reference

PostgreSQL result set implementation. More...

#include <postgresqlResultSet.hpp>

+ Inheritance diagram for anch::sql::PostgreSQLResultSet:
+ Collaboration diagram for anch::sql::PostgreSQLResultSet:

Public Member Functions

 PostgreSQLResultSet (PGconn *conn) noexcept
 
virtual ~PostgreSQLResultSet () noexcept
 
virtual bool next ()
 
- Public Member Functions inherited from anch::sql::ResultSet
 ResultSet () noexcept
 
virtual ~ResultSet () noexcept
 
template<typename T>
bool get (std::size_t idx, T &out)
 
template<typename T>
bool get (const std::string field, T &out)
 
template<typename T>
std::optional< T > get (std::size_t idx)
 
template<typename T>
const std::optional< T > get (const std::string field)
 

Protected Member Functions

virtual bool getValue (std::size_t idx, std::string &out) override
 
virtual std::optional< std::string > getValue (std::size_t idx) override
 
virtual const anch::date::DateFormattergetDateFormatter () override
 
virtual const anch::date::DateFormattergetTimeFormatter () override
 
virtual const anch::date::DateFormattergetTimestampFormatter () override
 
- Protected Member Functions inherited from anch::sql::ResultSet
const anch::date::DateFormattergetDefaultDateFormatter ()
 
const anch::date::DateFormattergetDefaultTimeFormatter ()
 
const anch::date::DateFormattergetDefaultTimestampFormatter ()
 

Additional Inherited Members

- Protected Attributes inherited from anch::sql::ResultSet
std::map< std::string, std::size_t > _fields
 

Detailed Description

PostgreSQL result set implementation.

Implements ResultSet for PostgreSQL

Author
Vincent Lachenal
Since
0.1

Constructor & Destructor Documentation

◆ PostgreSQLResultSet()

anch::sql::PostgreSQLResultSet::PostgreSQLResultSet ( PGconn * conn)
noexcept

PostgreSQLResultSet constructor

Parameters
connthe PostgreSQL database connection

◆ ~PostgreSQLResultSet()

virtual anch::sql::PostgreSQLResultSet::~PostgreSQLResultSet ( )
virtualnoexcept

PostgreSQLResultSet destructor

Member Function Documentation

◆ getDateFormatter()

virtual const anch::date::DateFormatter & anch::sql::PostgreSQLResultSet::getDateFormatter ( )
overrideprotectedvirtual

Retrieve SQL date formatter

Returns
the SQL date formatter

Implements anch::sql::ResultSet.

+ Here is the call graph for this function:

◆ getTimeFormatter()

virtual const anch::date::DateFormatter & anch::sql::PostgreSQLResultSet::getTimeFormatter ( )
overrideprotectedvirtual

Retrieve SQL time formatter

Returns
the SQL time formatter

Implements anch::sql::ResultSet.

+ Here is the call graph for this function:

◆ getTimestampFormatter()

virtual const anch::date::DateFormatter & anch::sql::PostgreSQLResultSet::getTimestampFormatter ( )
overrideprotectedvirtual

Retrieve SQL timestamp formatter

Returns
the SQL timestamp formatter

Implements anch::sql::ResultSet.

+ Here is the call graph for this function:

◆ getValue() [1/2]

virtual std::optional< std::string > anch::sql::PostgreSQLResultSet::getValue ( std::size_t idx)
overrideprotectedvirtual

Retrieve string value from result set according to SQL database engine.

Parameters
idxthe index
Returns
the result
Exceptions
SqlExceptionany error

Implements anch::sql::ResultSet.

+ Here is the call graph for this function:

◆ getValue() [2/2]

virtual bool anch::sql::PostgreSQLResultSet::getValue ( std::size_t idx,
std::string & out )
overrideprotectedvirtual

Retrieve string value from result set according to SQL database engine.

Parameters
idxthe field index
outthe result
Exceptions
SqlExceptionany error

Implements anch::sql::ResultSet.

+ Here is the call graph for this function:

◆ next()

virtual bool anch::sql::PostgreSQLResultSet::next ( )
virtual

Fetch next row in SQL result set.

Returns
true if next row exists, false otherwise
Exceptions
SqlExceptionany error

Implements anch::sql::ResultSet.

+ Here is the call graph for this function:

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