Sese Framework  2.3.0
A cross-platform framework
Loading...
Searching...
No Matches
sese::db::ResultSet Class Referenceabstract

Query result set. More...

#include <ResultSet.h>

Inheritance diagram for sese::db::ResultSet:
sese::db::impl::MariaResultSetImpl sese::db::impl::MariaStmtResultSet sese::db::impl::PostgresResultSetImpl sese::db::impl::SqliteResultSetImpl sese::db::impl::SqliteStmtResultSetImpl

Public Types

using Ptr = std::unique_ptr<ResultSet>
 

Public Member Functions

virtual ~ResultSet () noexcept=default
 
virtual void reset () noexcept=0
 Locate the first query record.
 
virtual bool next () noexcept=0
 Move to the next record.
 
virtual size_t getColumns () const noexcept=0
 Get the number of columns in the record.
 
virtual int32_t getInteger (size_t index) const noexcept=0
 Get an integer value from the current record.
 
virtual int64_t getLong (size_t index) const noexcept=0
 Get a long integer value from the current record.
 
virtual std::string_view getString (size_t index) const noexcept=0
 Get a string from the current record.
 
virtual double getDouble (size_t index) const noexcept=0
 Get a double-precision floating-point value from the current record.
 
virtual float getFloat (size_t index) const noexcept=0
 Get a single-precision floating-point value from the current record.
 
virtual std::optional< sese::DateTimegetDateTime (size_t index) const noexcept=0
 Get a time data structure from the current record.
 
virtual bool isNull (size_t index) const noexcept=0
 Determine if the returned result is null.
 

Detailed Description

Query result set.

Member Typedef Documentation

◆ Ptr

using sese::db::ResultSet::Ptr = std::unique_ptr<ResultSet>

Constructor & Destructor Documentation

◆ ~ResultSet()

virtual sese::db::ResultSet::~ResultSet ( )
virtualdefaultnoexcept

Member Function Documentation

◆ getColumns()

virtual size_t sese::db::ResultSet::getColumns ( ) const
nodiscardpure virtualnoexcept

Get the number of columns in the record.

Returns
Number of columns in the result set record

Implemented in sese::db::impl::MariaResultSetImpl, sese::db::impl::MariaStmtResultSet, sese::db::impl::PostgresResultSetImpl, sese::db::impl::SqliteResultSetImpl, and sese::db::impl::SqliteStmtResultSetImpl.

◆ getDateTime()

virtual std::optional< sese::DateTime > sese::db::ResultSet::getDateTime ( size_t index) const
nodiscardpure virtualnoexcept

Get a time data structure from the current record.

Parameters
indexIndex
Returns
Time data structure

Implemented in sese::db::impl::MariaResultSetImpl, sese::db::impl::MariaStmtResultSet, sese::db::impl::PostgresResultSetImpl, sese::db::impl::SqliteResultSetImpl, and sese::db::impl::SqliteStmtResultSetImpl.

◆ getDouble()

virtual double sese::db::ResultSet::getDouble ( size_t index) const
nodiscardpure virtualnoexcept

Get a double-precision floating-point value from the current record.

Parameters
indexIndex
Returns
Double-precision floating-point value

Implemented in sese::db::impl::MariaResultSetImpl, sese::db::impl::MariaStmtResultSet, sese::db::impl::PostgresResultSetImpl, sese::db::impl::SqliteResultSetImpl, and sese::db::impl::SqliteStmtResultSetImpl.

◆ getFloat()

virtual float sese::db::ResultSet::getFloat ( size_t index) const
nodiscardpure virtualnoexcept

Get a single-precision floating-point value from the current record.

Parameters
indexIndex
Returns
Single-precision floating-point value

Implemented in sese::db::impl::MariaResultSetImpl, sese::db::impl::MariaStmtResultSet, sese::db::impl::PostgresResultSetImpl, sese::db::impl::SqliteResultSetImpl, and sese::db::impl::SqliteStmtResultSetImpl.

◆ getInteger()

virtual int32_t sese::db::ResultSet::getInteger ( size_t index) const
nodiscardpure virtualnoexcept

◆ getLong()

virtual int64_t sese::db::ResultSet::getLong ( size_t index) const
nodiscardpure virtualnoexcept

Get a long integer value from the current record.

Parameters
indexIndex
Returns
Long integer value

Implemented in sese::db::impl::MariaResultSetImpl, sese::db::impl::MariaStmtResultSet, sese::db::impl::PostgresResultSetImpl, sese::db::impl::SqliteResultSetImpl, and sese::db::impl::SqliteStmtResultSetImpl.

◆ getString()

virtual std::string_view sese::db::ResultSet::getString ( size_t index) const
nodiscardpure virtualnoexcept

◆ isNull()

virtual bool sese::db::ResultSet::isNull ( size_t index) const
nodiscardpure virtualnoexcept

Determine if the returned result is null.

Parameters
indexIndex
Returns
Whether it is null

Implemented in sese::db::impl::MariaResultSetImpl, sese::db::impl::MariaStmtResultSet, sese::db::impl::PostgresResultSetImpl, sese::db::impl::SqliteResultSetImpl, and sese::db::impl::SqliteStmtResultSetImpl.

◆ next()

virtual bool sese::db::ResultSet::next ( )
nodiscardpure virtualnoexcept

◆ reset()

virtual void sese::db::ResultSet::reset ( )
pure virtualnoexcept

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