ADBC
Arrow Database Connectivity
|
Base class for private_data of AdbcDatabase, AdbcConnection, and AdbcStatement. More...
#include <base_driver.h>
Public Member Functions | |
virtual AdbcStatusCode | Init (void *parent, AdbcError *error) |
Initialize the object. | |
virtual AdbcStatusCode | Release (AdbcError *error) |
Finalize the object. | |
virtual Result< Option > | GetOption (std::string_view key) |
Get an option value. | |
virtual AdbcStatusCode | SetOption (std::string_view key, Option value, AdbcError *error) |
Set an option value. | |
Protected Attributes | |
LifecycleState | lifecycle_state_ |
Private Member Functions | |
template<typename T > | |
AdbcStatusCode | CSetOption (const char *key, T value, AdbcError *error) |
AdbcStatusCode | CSetOptionBytes (const char *key, const uint8_t *value, size_t length, AdbcError *error) |
template<typename T > | |
AdbcStatusCode | CGetOptionStringLike (const char *key, T *value, size_t *length, AdbcError *error) |
template<typename T > | |
AdbcStatusCode | CGetOptionNumeric (const char *key, T *value, AdbcError *error) |
Friends | |
template<typename DatabaseT , typename ConnectionT , typename StatementT > | |
class | Driver |
Base class for private_data of AdbcDatabase, AdbcConnection, and AdbcStatement.
This class handles option setting and getting.
Get an option value.
Reimplemented in adbc::driver::Connection< Derived >.
|
inlinevirtual |
Initialize the object.
Called after 0 or more SetOption calls. Generally, you won't need to override this directly. Instead, use the typed InitImpl provided by Database/Connection/Statement.
[in] | parent | A pointer to the AdbcDatabase or AdbcConnection implementation as appropriate, or nullptr. |
Reimplemented in adbc::driver::BaseConnection< Derived >, adbc::driver::BaseDatabase< Derived >, adbc::driver::BaseStatement< Derived >, adbc::driver::Connection< Derived >, and adbc::driver::Statement< Derived >.
|
inlinevirtual |
Finalize the object.
This can be used to return an error if the object is not in a valid state (e.g. prevent closing a connection with open statements) or to clean up resources when resource cleanup could fail. Infallible resource cleanup (e.g. releasing memory) should generally be handled in the destructor.
Generally, you won't need to override this directly. Instead, use the typed ReleaseImpl provided by Database/Connection/Statement.
Reimplemented in adbc::driver::BaseConnection< Derived >, adbc::driver::BaseDatabase< Derived >, adbc::driver::BaseStatement< Derived >, adbc::driver::Connection< Derived >, and adbc::driver::Statement< Derived >.
|
inlinevirtual |
Set an option value.
Reimplemented in adbc::driver::BaseConnection< Derived >, adbc::driver::BaseDatabase< Derived >, adbc::driver::BaseStatement< Derived >, adbc::driver::Connection< Derived >, and adbc::driver::Statement< Derived >.