|
nanodbc
A small C++ wrapper for the native C ODBC API
|
A class representing a connection or a statement attribute. More...
#include <nanodbc.h>

Public Types | |
| using | variant = std::variant< std::vector< uint8_t >, string, std::intptr_t, std::uintptr_t > |
Public Member Functions | |
| attribute & | operator= (attribute const &)=delete |
| attribute (attribute const &other) noexcept | |
| Copy constructor. | |
| attribute (long const &attribute, long const &string_length, variant const &resource) noexcept | |
| Creates an attribute from the three arguments the ODBC call takes. | |
Protected Member Functions | |
| void | extractValuePtr () noexcept |
| Points value_ptr_ at the resource, according to which type it holds. | |
A class representing a connection or a statement attribute.
Callers should create attributes using the 3 argument constructor. First argument is the Attribute argument to the ODBC API call - a std::variant, is a type safe union of std::vector<uint8_t> ( binary buffer payloads ), nanodbc::string ( string payloads ), or std::(u)intptr_t, for both u/int payloads, as well as pointers to more generic buffers.
See https://learn.microsoft.com/en-us/sql/odbc/reference/syntax/sqlsetconnectattr-function
|
noexcept |
Creates an attribute from the three arguments the ODBC call takes.
| attribute | The Attribute argument of SQLSetConnectAttr or SQLSetStmtAttr. |
| string_length | The StringLength argument. |
| resource | The value the ValuePtr argument should refer to. |
|
protectednoexcept |
Points value_ptr_ at the resource, according to which type it holds.
Visiting a variant that always holds an alternative cannot throw, and the two constructors calling this are themselves noexcept.