Lightweight 0.20260625.0
Loading...
Searching...
No Matches
Lightweight::SqlDiagnosticSource Class Referenceabstract

Supplies diagnostics for an ODBC handle. More...

#include <SqlError.hpp>

Public Member Functions

 SqlDiagnosticSource (SqlDiagnosticSource const &)=delete
 
SqlDiagnosticSourceoperator= (SqlDiagnosticSource const &)=delete
 
 SqlDiagnosticSource (SqlDiagnosticSource &&)=delete
 
SqlDiagnosticSourceoperator= (SqlDiagnosticSource &&)=delete
 
virtual SqlErrorInfo Diagnose (SQLSMALLINT handleType, SQLHANDLE handle)=0
 Returns the diagnostics for the given handle.
 

Detailed Description

Supplies diagnostics for an ODBC handle.

Exists so error paths can be driven from a unit test without a database. Production code never installs one: with no source configured, SqlErrorInfo reads diagnostics from the driver as usual. A test installs a source that returns a scripted SqlErrorInfo, which makes the classification and propagation logic reachable without provoking a real driver failure.

See also
SetDiagnosticSource

Definition at line 74 of file SqlError.hpp.

Member Function Documentation

◆ Diagnose()

virtual SqlErrorInfo Lightweight::SqlDiagnosticSource::Diagnose ( SQLSMALLINT  handleType,
SQLHANDLE  handle 
)
pure virtual

Returns the diagnostics for the given handle.

Parameters
handleTypeOne of SQL_HANDLE_ENV, SQL_HANDLE_DBC or SQL_HANDLE_STMT.
handleThe handle the diagnostics are requested for. A fake may ignore it.
Returns
The diagnostics to report for handle.

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