Lightweight 0.20250904.0
Loading...
Searching...
No Matches
Lightweight::SqlErrorInfo Struct Reference

Represents an ODBC SQL error. More...

#include <SqlError.hpp>

Static Public Member Functions

static SqlErrorInfo FromConnectionHandle (SQLHDBC hDbc)
 Constructs an ODBC error info object from the given ODBC connection handle.
 
static SqlErrorInfo FromStatementHandle (SQLHSTMT hStmt)
 Constructs an ODBC error info object from the given ODBC statement handle.
 
static void RequireStatementSuccess (SQLRETURN result, SQLHSTMT hStmt, std::string_view message)
 Asserts that the given result is a success code, otherwise throws an exception.
 

Public Attributes

SQLINTEGER nativeErrorCode {}
 
std::string sqlState = " "
 
std::string message
 

Detailed Description

Represents an ODBC SQL error.

NOTE: This is a simple wrapper around the SQL return codes. It is not meant to be comprehensive, but rather to provide a simple way to convert SQL return codes to std::error_code.

The code below is DRAFT and may be subject to change.

Definition at line 32 of file SqlError.hpp.

Member Function Documentation

◆ FromConnectionHandle()

static SqlErrorInfo Lightweight::SqlErrorInfo::FromConnectionHandle ( SQLHDBC  hDbc)
inlinestatic

Constructs an ODBC error info object from the given ODBC connection handle.

Definition at line 39 of file SqlError.hpp.

◆ FromStatementHandle()

static SqlErrorInfo Lightweight::SqlErrorInfo::FromStatementHandle ( SQLHSTMT  hStmt)
inlinestatic

Constructs an ODBC error info object from the given ODBC statement handle.

Definition at line 45 of file SqlError.hpp.

Referenced by Lightweight::SqlStatement::Execute(), and Lightweight::SqlStatement::LastError().

Member Data Documentation

◆ nativeErrorCode

SQLINTEGER Lightweight::SqlErrorInfo::nativeErrorCode {}

Definition at line 34 of file SqlError.hpp.

◆ sqlState

std::string Lightweight::SqlErrorInfo::sqlState = " "

Definition at line 35 of file SqlError.hpp.

◆ message

std::string Lightweight::SqlErrorInfo::message

Definition at line 36 of file SqlError.hpp.


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