6#include "../../Api.hpp"
7#include "../../SqlBindingTypes.hpp"
8#include "../../SqlError.hpp"
10#include "SqlOdbcPrelude.hpp"
13#include <source_location>
18namespace Lightweight::Driver::Odbc
27[[nodiscard]]
constexpr SqlResult ToResult(SQLRETURN rc)
noexcept
29 return static_cast<SqlResult
>(rc);
104using ::Lightweight::
Driver::ClassifyResult;
111LIGHTWEIGHT_API
void LogIfFailed(
Statement const& stmt, SqlResult result, std::source_location location);
152 [[nodiscard]]
virtual std::optional<SqlErrorInfo>
NextFailure(SQLHSTMT hStmt,
153 std::source_location
const& sourceLocation) = 0;
175 [[maybe_unused]] SQLHDBC hDbc, [[maybe_unused]] std::source_location
const& sourceLocation)
187LIGHTWEIGHT_API
void SetFaultSource(SqlFaultSource* source)
noexcept;
190[[nodiscard]] LIGHTWEIGHT_API SqlFaultSource* GetFaultSource() noexcept;
202LIGHTWEIGHT_API
void RequireSuccess(Statement const& stmt,
204 std::source_location location = std::source_location::current());
235 [[nodiscard]] LIGHTWEIGHT_API OdbcCallOutcome
236 CheckOdbcCall(SQLRETURN result, SQLHSTMT hStmt, std::source_location sourceLocation = std::source_location::current());
252 [[nodiscard]] LIGHTWEIGHT_API OdbcCallOutcome CheckOdbcConnectionCall(
253 SQLRETURN result, SQLHDBC hDbc, std::source_location sourceLocation = std::source_location::current());
Supplies diagnostics for an ODBC handle.
virtual SqlErrorInfo Diagnose(SQLSMALLINT handleType, SQLHANDLE handle)=0
Returns the diagnostics for the given handle.
Substitutes a scripted failure for an ODBC call that actually succeeded.
virtual std::optional< SqlErrorInfo > NextFailure(SQLHSTMT hStmt, std::source_location const &sourceLocation)=0
Decides whether the next statement-handle check should fail.
virtual std::optional< SqlErrorInfo > NextConnectionFailure(SQLHDBC hDbc, std::source_location const &sourceLocation)
Decides whether the next connection-handle check should fail.
Verdict of a non-throwing checked driver call, carrying the diagnostic that justifies a failure verdi...
The ODBC driver's connection handle struct.
The ODBC driver: names its handle structs and its driver id.
The ODBC driver's statement handle struct.
Represents a SQL error as reported by the database driver.