ADBC
Arrow Database Connectivity
Loading...
Searching...
No Matches
adbc::driver::Status Class Reference

A wrapper around AdbcStatusCode + AdbcError. More...

#include <status.h>

Classes

struct  Impl
 Private Status implementation details. More...
 

Public Member Functions

 Status ()
 Construct an OK status.
 
 Status (AdbcStatusCode code, std::string message)
 Construct a non-OK status with a message.
 
 Status (AdbcStatusCode code, const char *message)
 Construct a non-OK status with a message.
 
 Status (AdbcStatusCode code, std::string message, std::vector< std::pair< std::string, std::string > > details)
 Construct a non-OK status with a message and details.
 
bool ok () const
 Check if this is an error or not.
 
void AddDetail (std::string key, std::string value)
 Add another error detail.
 
void SetSqlState (std::string sqlstate)
 Set the sqlstate of this status.
 
AdbcStatusCode ToAdbc (AdbcError *adbc_error) const
 Export this status to an AdbcError.
 
int CDetailCount () const
 
AdbcErrorDetail CDetail (int index) const
 

Static Public Member Functions

static Status FromAdbc (AdbcStatusCode code, AdbcError &error)
 
static Status Ok ()
 

Static Private Member Functions

static void CRelease (AdbcError *error)
 

Private Attributes

std::unique_ptr< Implimpl_
 

Friends

template<typename DatabaseT , typename ConnectionT , typename StatementT >
class Driver
 

Detailed Description

A wrapper around AdbcStatusCode + AdbcError.

Drivers should prefer to use Status, and convert at the boundaries with ToAdbc.

Constructor & Destructor Documentation

◆ Status() [1/4]

adbc::driver::Status::Status ( )
inline

Construct an OK status.

◆ Status() [2/4]

adbc::driver::Status::Status ( AdbcStatusCode code,
std::string message )
inlineexplicit

Construct a non-OK status with a message.

◆ Status() [3/4]

adbc::driver::Status::Status ( AdbcStatusCode code,
const char * message )
inlineexplicit

Construct a non-OK status with a message.

◆ Status() [4/4]

adbc::driver::Status::Status ( AdbcStatusCode code,
std::string message,
std::vector< std::pair< std::string, std::string > > details )
inlineexplicit

Construct a non-OK status with a message and details.

Member Function Documentation

◆ AddDetail()

void adbc::driver::Status::AddDetail ( std::string key,
std::string value )
inline

Add another error detail.

◆ ok()

bool adbc::driver::Status::ok ( ) const
inline

Check if this is an error or not.

◆ SetSqlState()

void adbc::driver::Status::SetSqlState ( std::string sqlstate)
inline

Set the sqlstate of this status.

◆ ToAdbc()

AdbcStatusCode adbc::driver::Status::ToAdbc ( AdbcError * adbc_error) const
inline

Export this status to an AdbcError.


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