ADBC
Arrow Database Connectivity
|
The CRTP base implementation of an AdbcConnection. More...
#include <connection.h>
Public Types | |
enum class | AutocommitState { kAutocommit , kTransaction } |
Whether autocommit is enabled or not (by default: enabled). More... | |
using | Base = Connection<Derived> |
Public Member Functions | |
AdbcStatusCode | Init (void *parent, AdbcError *error) override |
Initialize the object. | |
AdbcStatusCode | Cancel (AdbcError *error) |
AdbcStatusCode | Commit (AdbcError *error) |
AdbcStatusCode | GetInfo (const uint32_t *info_codes, size_t info_codes_length, ArrowArrayStream *out, AdbcError *error) |
AdbcStatusCode | GetObjects (int c_depth, const char *catalog, const char *db_schema, const char *table_name, const char **table_type, const char *column_name, ArrowArrayStream *out, AdbcError *error) |
Result< Option > | GetOption (std::string_view key) override |
Get an option value. | |
AdbcStatusCode | GetStatistics (const char *catalog, const char *db_schema, const char *table_name, char approximate, ArrowArrayStream *out, AdbcError *error) |
AdbcStatusCode | GetStatisticNames (ArrowArrayStream *out, AdbcError *error) |
AdbcStatusCode | GetTableSchema (const char *catalog, const char *db_schema, const char *table_name, ArrowSchema *schema, AdbcError *error) |
AdbcStatusCode | GetTableTypes (ArrowArrayStream *out, AdbcError *error) |
AdbcStatusCode | ReadPartition (const uint8_t *serialized_partition, size_t serialized_length, ArrowArrayStream *out, AdbcError *error) |
AdbcStatusCode | Release (AdbcError *error) override |
Finalize the object. | |
AdbcStatusCode | Rollback (AdbcError *error) |
AdbcStatusCode | SetOption (std::string_view key, Option value, AdbcError *error) override |
Set an option value. | |
Status | CommitImpl () |
Commit the current transaction and begin a new transaction. | |
Result< std::optional< std::string > > | GetCurrentCatalogImpl () |
Result< std::optional< std::string > > | GetCurrentSchemaImpl () |
Result< std::unique_ptr< GetObjectsHelper > > | GetObjectsImpl () |
Query the database catalog. | |
Status | GetTableSchemaImpl (std::optional< std::string_view > catalog, std::optional< std::string_view > db_schema, std::string_view table_name, ArrowSchema *schema) |
Result< std::vector< std::string > > | GetTableTypesImpl () |
Result< std::vector< InfoValue > > | InfoImpl (const std::vector< uint32_t > &codes) |
Status | InitImpl (void *parent) |
Status | ReleaseImpl () |
Status | RollbackImpl () |
Status | SetOptionImpl (std::string_view key, Option value) |
Status | ToggleAutocommitImpl (bool enable_autocommit) |
Protected Attributes | |
AutocommitState | autocommit_ = AutocommitState::kAutocommit |
Protected Attributes inherited from adbc::driver::ObjectBase | |
LifecycleState | lifecycle_state_ |
Private Member Functions | |
Derived & | impl () |
The CRTP base implementation of an AdbcConnection.
Derived should override and implement the Impl methods, but not others. Overridden methods should defer to the superclass version at the end. (The Base typedef is provided to make this easier.) Derived should also define a constexpr static symbol called kErrorPrefix that is used to construct error messages.
|
strong |
Whether autocommit is enabled or not (by default: enabled).
|
inline |
Commit the current transaction and begin a new transaction.
Only called when autocommit is disabled.
|
inline |
Query the database catalog.
The default implementation assumes the underlying database allows querying the catalog in a certain manner, embodied in the helper class returned here. If the database can directly implement GetObjects, then directly override GetObjects instead of using this helper.
|
inlineoverridevirtual |
Get an option value.
Reimplemented from adbc::driver::ObjectBase.
|
inlineoverridevirtual |
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 from adbc::driver::ObjectBase.
|
inlineoverridevirtual |
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 from adbc::driver::ObjectBase.
|
inlineoverridevirtual |
Set an option value.
Reimplemented from adbc::driver::ObjectBase.