Hyper API for C++ 0.0.18825
Hyper client library for C++ applications
Loading...
Searching...
No Matches
hyperapi::Result Class Referencefinal

Base class for a result of a query. More...

#include <Result.hpp>

Public Member Functions

 Result ()
 Constructs an empty Result object.
 
 Result (Result &&other) noexcept
 Move constructor.
 
Resultoperator= (Result &&other) noexcept
 Move assignment operator.
 
Resultoperator= (const Result &other)=delete
 Copy is forbidden.
 
 Result (const Result &other)=delete
 
const ResultSchemagetSchema () const noexcept
 Returns schema of the result.
 
optional< size_t > getAffectedRowCount () const
 Get the affected row count, if the statement had any.
 
ConnectiongetConnection ()
 Returns the connection of the SQL statement that yielded this result.
 
bool isOpen () const noexcept
 Checks whether the result is open.
 
void close () noexcept
 Closes the result.
 

Detailed Description

Base class for a result of a query.

Note: While this resource is open, the connection is busy.

Examples
read_and_print_data_from_existing_hyper_file.cpp, and update_data_in_existing_hyper_file.cpp.

Definition at line 325 of file Result.hpp.

Constructor & Destructor Documentation

◆ Result()

hyperapi::Result::Result ( )
inline

Constructs an empty Result object.

Postcondition
!isOpen()
Exceptions
std::bad_alloc

Definition at line 332 of file Result.hpp.

Member Function Documentation

◆ close()

void hyperapi::Result::close ( )
noexcept

Closes the result.

Makes the connection usable again.

Postcondition
!isOpen()

◆ getAffectedRowCount()

optional< size_t > hyperapi::Result::getAffectedRowCount ( ) const

Get the affected row count, if the statement had any.

If this result also produced rows, then this method is only accessible after having read all rows.

Returns
the affected row count if available.
Precondition
isOpen()
Exceptions
HyperException

◆ getConnection()

Connection & hyperapi::Result::getConnection ( )

Returns the connection of the SQL statement that yielded this result.

Precondition
isOpen()

◆ getSchema()

const ResultSchema & hyperapi::Result::getSchema ( ) const
inlinenoexcept

Returns schema of the result.

Returns
The result schema.

Definition at line 350 of file Result.hpp.

◆ isOpen()

bool hyperapi::Result::isOpen ( ) const
noexcept

Checks whether the result is open.

The connection is unusable as long as a result is still open.

Returns
Whether the result is open.

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